Frage

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>
War es hilfreich?

Lösung

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>

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top