Forum Moderators: open
<textarea name="whatever" rows="6" cols="27">blah blah blah...</textarea>
and I want the "blah blah" to disappear when my customer clicks inside the textarea to write their message. But I only want it to happen the first time they click, so if they start writing their message, then stop and click somewhere else for a moment, then click back in the textarea to finish their message it won't erase what they've typed again.
How do I do this with javascript, or better, some other method? Thanks people.
<textarea onFocus="this.value=''; this.onfocus=null;" name="whatever" rows="6" cols="27" >
blah blah blah...</textarea>
First, I have multiple forms - with radio buttons and two textareas per form - on one page (don't ask why - it's more than I want to explain here).
Second, and more importantly, each form has a reset button to clear the form and start over. This clears the radio buttons and the textareas of any added text after the "blah blah".
Both solutions clear the textareas of the "blah blah" on the first click in a textarea, and allow the focus to leave the textarea and return without clearing on the second click. However, if the customer wants to start over and they push the reset button, the "blah blah" returns to the textareas that have been cleared and they can't be cleared again without refreshing the page.
What would be nice is have the javascript reset also when the reset button is pushed so that a textarea will only clear once after the page is loaded and once after each time the reset button is pushed.
Maybe this is asking too much, but hopefully not.