further to a previous question, I have this code:
<p class="required">
{开发者_开发问答err for="msg"}
<!--{{label {t _inquiry_msg}:}}-->
{textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';"}
{/err}
</p>
And I want the output to be
<textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>
I tried {/textarea}
but it didn't work in my template file.
Also, using html <>
tags doesn't work, it breaks the page.
http://euroworker.no/Konftel-300-IP.268
Is it possible to make this in smarty/php?
Thanks :)
Write directly:
<textarea onblur="if(this.value=='') this.value='Skriv her';"
onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>
If it does not work, it has nothing to do with smarty.
Just put:
<textarea onblur="if(this.value=='') this.value='Skriv her';"
onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>
Smarty will not replace anything.
You really ought to start with the W3C markup validator and than try to find your bug.
You missed something here:
<!--{{label {t _inquiry_msg}:}}-->
I don't know what this code should do but the error is definitely here
<!--{{label} {t _inquiry_msg}:}}-->
then the HTML should work fine
<textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>
Please try the following steps, and keep commenting:-
- Please try to remove the whole commented line, between the "{err for="msg"}" line & the "{textarea}" line.
- Now remove the curly braces from the "textarea" line of code, and write plain HTML, just like "Luis Melgratti" posted in his answer.
- If possible, try to upload some screenshot images of the error, which the page is showing.
Smarty 3 or Smarty 2? Because in version 3 the tag filtering {...}
has been way improved.
精彩评论