Pregunta

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>
¿Fue útil?

Solución

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>

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top