Question

I am having some difficulty with a form field where it is only the textarea field causing the issue that the value appears after I click into the textarea and not already appearing like the input fields:

<textarea name="enquiry" id="enquiry" onfocus="if(this.value == 'Enquiry') this.value='';" onblur="this.value=!this.value?'Enquiry':this.value;" value="Enquiry"></textarea>
Était-ce utile?

La solution

Try this,

<textarea name="enquiry" id="enquiry" onfocus="if(this.value == 'Enquiry') this.value='';" onblur="this.value=!this.value?'Enquiry':this.value;">Enquiry</textarea>

Just remove the value attribute and put the text inside <textarea></textarea>

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top