views:

176

answers:

1

Here is my jsfiddle example, the textarea shows no value onload, but will onblur, does textarea not accept the value attribute?

+2  A: 

Here is the solution :)

Because you are using a textarea, its value comes in between its tag name:

<textarea class="jsf" name="msg" onblur="if(this.value=='') this.value='Write here!';" onfocus="if(this.value=='Write here!') this.value='';">Write here!</textarea>

Sarfraz
Thanks, but how do I add this to `{textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';"}`? there isn't an option to close the tags in this smarty system, I tried with `{/textarea}` but it broke it.
Kyle Sevenoaks
@Kyle Sevenoaks: sorry but i have no idea about smarty because i have not used it yet :(
Sarfraz
@Sarfraz: no worries, I'll figure it out :) Thanks for pointing me in the right direction.
Kyle Sevenoaks