I'm trying to input a textarea tag when I submit my form:
<textarea id="confirmationText" class="text" cols="86" rows ="20" name="confirmationText" form="confirmationForm"></textarea> <form action="sendConfirmation.php" name="confirmationForm" method="post"> <input type="submit" value="Email" class="submitButton"> </form>
As you can see I've set the form="confirmationForm" attribute in my textarea tag. I've used Live HTTP Headers to catch the POST request and it is empty (so I know the problem is not in sendConfirmation.php, the problem is that the confirmationText is not being POSTed). I've searched the net and as far as I can see I've set it correctly.
The <textarea> tag defines a multi-line text input control. The <textarea> element is often used in a form, to collect user inputs like comments or reviews. A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).
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.
Use the <textarea> tag to show a text area. The HTML <textarea> tag is used within a form to declare a textarea element - a control that allows the user to input text over multiple rows. Specifies that on page load the text area should automatically get focus.
<textarea> does not support the value attribute.
try to put it inside the form tag as follows... it should work
<form action="sendConfirmation.php" name="confirmationForm" method="post"> <textarea id="confirmationText" class="text" cols="86" rows ="20" name="confirmationText"></textarea> <input type="submit" value="Email" class="submitButton"> </form>
however you can use the same approach as well but you need to provide the from id attribute then
<form action="sendConfirmation.php" id="confirmationForm" method="post"> <input type="submit" value="Email" class="submitButton"> </form>
You must put in the form attribute of the textarea the form's id, not it's name.
try:
<textarea id="confirmationText" class="text" cols="86" rows ="20" name="confirmationText" form="confirmationForm"></textarea> <form action="sendConfirmation.php" id="confirmationForm" name="confirmationForm" method="post"> <input type="submit" value="Email" class="submitButton"> </form>
source: http://www.w3schools.com/tags/att_textarea_form.asp
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