I have a simple contact form on a website that has 2 text fields, 1 textarea, and 1 hidden field.
For some reason, all the fields POST to a PHP script except the tex
You only need to add an ID value to the form and then add the form attribute to the textarea with the form ID value
<form id="sample".....>
<textarea name="aba" form="sample".....></textarea>
</form>
I once experienced an error similar to yours. What helped me was to use different id
and name
parameters. Try and see for yourself, because you have them identical here.
Though in your case you don't have the textarea
set to disabled
, the reason I found this post was because I wasn't getting a value from a textarea
that was. So here's a note for anyone else with that issue.
To POST
the value from a textarea
where you want the field to be non-editiable, use readonly
instead of disabled
- either directly in html or via setAttribute
in JavaScript - and then use CSS to highlight it, eg:
textarea[readonly] {background-color:#F0F0F0;})