Jump to content

Recommended Posts

Posted

And this is an issue because if the user has made a mistake on the form and has to make a correction, he/she also now has to retype everything in the textarea again before re-submission. And the textarea's the only input device that loses its input. Input boxes are fine, as are the selected select options. Is this a natural behavior? Is there a way around it?

Posted

When the user submits the form, you'd want to store the data from the textarea, and then insert it back into the textarea when you re-show the form with the error message.

 

Take a look at this tutorial: http://www.w3schools.com/php/php_forms.asp, clicking right through the chapters on making form fields required and validating the data. Specifically look at the "Keep the values in the form" section of http://www.w3schools.com/php/php_form_complete.asp.

Posted

Great information. Thank you, Ben. I see that I was making my mistake by using "value = " in echoing the textarea variable. Seems that value isn't used with textarea at all. Who'd've thunk it? :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...