javascript in form gives smarty error
Posted: Thu Nov 29, 2007 11:47 pm
I have a form on the page and I'm trying to use the following code to make the text "enter your email" disappear when the form field is clicked:
Whether i put the code directly into the page or in a content block the result is similar:
string(131) "Smarty error: [in globalcontent:mailinglist line 8]: syntax error: unrecognized tag: this.value='' (Smarty_Compiler.class.php, line 446)" string(119) "Smarty error: [in globalcontent:mailinglist line 8]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
Subsequent reloads of the page remove the error, but also strip out the offfending code from the form:
{ this.value=''; }"
Is there any way to get this to work?
thanks
Gareth
Code: Select all
<input name="email" id="email" value="enter your email" size="20" onfocus="if(this.value=='enter your email') {this.value=''}" type="text" />string(131) "Smarty error: [in globalcontent:mailinglist line 8]: syntax error: unrecognized tag: this.value='' (Smarty_Compiler.class.php, line 446)" string(119) "Smarty error: [in globalcontent:mailinglist line 8]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
Subsequent reloads of the page remove the error, but also strip out the offfending code from the form:
{ this.value=''; }"
Is there any way to get this to work?
thanks
Gareth