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.
The HTML <textarea> autocomplete Attribute is used to specify whether the Textarea field has autocomplete on or off. When the autocomplete attribute is set to on, the browser will automatically complete the values based on which the user entered before.
Yes you can use textarea tags outside of a form and they will display and allow text to be inserted and edited, but not being tied to a form their uses will likely be limited.
From the MDN documentation: " <textarea> does not support the value attribute".
<textarea>This is where you put the text.</textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With