How can I quotpre-fillquot the value of a textarea in an HTML form

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I m creating a simple back-end app through which the user can create/update/delete database rows (in this case, job listings).

When it comes time for the user to edit an existing listing, I m trying to pre-fill most of the HTML form with the data from that existing row. I ve done this sucessfully for text inputs using the "value" property, and with selects using a bit of php in each option tag: if([conditionforoption]){echo selected }.

The input type that I m having trouble pre-filling is the textarea... any thoughts on how to get the existing data (a long varchar string) to be present in the textarea input when the user loads the page?

I m trying to stay away from a javascript solution if at all possible, but I ll use it if necessary.

Answers

<textarea>This is where you put the text.</textarea>

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/2231936/how-can-i-pre-fill-the-value-of-a-textarea-in-an-html-form

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils