Landslyde Posted February 20, 2015 Report Share Posted February 20, 2015 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? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 20, 2015 Report Share Posted February 20, 2015 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. Quote Link to comment Share on other sites More sharing options...
Landslyde Posted February 20, 2015 Author Report Share Posted February 20, 2015 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.