`hi, follow this example and you should ok
`
or just follow this tutorial: http://goo.gl/Wt84G
This is what I use on my site. Insert this in your post-form.php:
`$(‘textarea’).each(function() {
$(this).data(‘default’, this.value);
}).focusin(function() {
if ( this.value == $(this).data(‘default’) ) {
this.value = ”;
}
}).focusout(function() {
if ( this.value == ” ) {
this.value = $(this).data(‘default’);
}
});`
The above solution will work as well, but the text won’t re-appear if the user clicks off the textarea.
Forget all that. Use the HTML5 placeholder attribute.
http://diveintohtml5.org/forms.html#placeholder
Forget that html5 an unratified proposal don’t forget things may change, behavior is the safe way of handling this, and anyway you would need to switch to a plain Doc Type sans formal identifier.
You avant guard coders !
I think that’s mostly rubbish in this day and age. Every decent browser supports placeholder, and a lot of other HTML5 features. HTML’s moved away from a “what’s in this version of the specs” to a “what does your browser support” model.
@virtuali Exactly where in post-form.php should I put that code ?