![]() |
fatal error with embbeded page
Hello
I am trying to get a java scripted vat calculator to sit in the centre box of my xcart. I created an embedded page then put my code in after, and ftpd it back. The error i get when i click the link on my site is: ============================================ Fatal error: Smarty: [in evaluated template line 5]: syntax error: expecting '=' after attribute name 'var' (Smarty_Compiler.class.php, line 1350) in /home/uxwywjo/public_html/shop/Smarty-2.5.0/Smarty_Compiler.class.php on line 1832 ============================================ Heres the code for the calculator: ============================================= <html><head> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function doMath() { var one = eval(document.myform.total.value) var two = eval(document.myform.vat.value) var prod = one * two document.myform.amount.value=custRound(prod,2); } function custRound(x,places) { return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places) } // End --> </SCRIPT> </head> <body> <CENTER> <FORM NAME="myform"> <table border="2" bordercolor="#000080" bgcolor="E0F3FC"> <tr> <td bordercolor="E0F3FC"><font color="#000080" face="Verdana">Total Excluding VAT</font></td> <td bordercolor="E0F3FC"> <input type="text" size="10" style="BORDER-RIGHT: #052067 1px solid; BORDER-TOP: #052067 1px solid; BORDER-LEFT: #052067 1px solid; BORDER-BOTTOM: #052067 1px solid;"class="text" name="total"> </td> </tr> <tr> <td bordercolor="E0F3FC" bordercolor="E0F3FC"><font color="#000080" face="Verdana">VAT rate</font></td> <td bordercolor="E0F3FC"> <input type="text" size="10" value="1.175" style="BORDER-RIGHT: #052067 1px solid; BORDER-TOP: #052067 1px solid; BORDER-LEFT: #052067 1px solid; BORDER-BOTTOM: #052067 1px solid;"class="text" name="vat"> </td> </tr> <tr> <td bordercolor="E0F3FC"><font color="#000080" face="Verdana">Total Including VAT</font></td> <td bordercolor="E0F3FC"> <input type="text" size="10" style="BORDER-RIGHT: #052067 1px solid; BORDER-TOP: #052067 1px solid; BORDER-LEFT: #052067 1px solid; BORDER-BOTTOM: #052067 1px solid;"class="text" name="amount"> </td> </tr> <tr> <td> </td> <td bordercolor="E0F3FC"> <input type="button" value="Calculate" onClick="doMath()" name="button" style="background: 052067; color: yellow; font-size: 0.9 em; font-face: verdana" class="button"> </td> </tr> <tr><td bordercolor="E0F3FC"></td></tr> <tr></td><td bordercolor="E0F3FC" align="left"></td></tr> </table> </FORM> <table border="2" bordercolor="#000080" bgcolor="E0F3FC"> <tr> <td bordercolor="E0F3FC" width=253><font color="#000080" face="Verdana" size="-2">To calculate the VAT on any given amount simply type that amount in the top box then click the 'calculate' button. </font></td> </td></tr> </CENTER> </body> </html> =========================================== Any ideas please?....Help !!!!!! |
ok now have wrapped javascript inside literal tags.....page now displays...but calculator does not calculate!!!
|
BTT Bump !!...please help!!!!
|
did you check the setting to allow smarty tags in embedded pages ?
|
Please post code inside of code tags. It makes it so much easier to read, and thus easier to get help.
|
hello shan...no i didnt...where is it please?!!
ADP...sorry mate I am not sure what your talking about??, what tags? |
When you post, highlight the code areas and click the "code" formatting button.
It will wrap your text like this Code:
CODE I'm checking to find the setting but if you would post your version # in your signature, it would help me look in the correct version. |
In version 4.0.x it is in general settings, about 8 up from the bottom.
|
oh i see, sorry about that.
Thanks for the advice people, much appreciated, off to give it a try. Scott |
its version 3.5.9 btw
I have this ticked: Parse Smarty tags in the content of embedded static pages: Is that correct? scott |
Fat BTT ... Help still needed !! and appreciated
scott |
All times are GMT -8. The time now is 02:01 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.