can anyone help how i can retain a text area content.
bcoz for any reason if the page fails the validation , my requirement is to retain the content .
Please help very urgent.
regards
TEXT AREA content retaining
Moderator: General Moderators
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: TEXT AREA content retaining
Something like this:
Remember that with sticky forms like this you should clear the $_POST array after you've dealt with it's contents on a successful submission.
Code: Select all
echo '<textarea name="stuff">';
if(isset($_POST['stuff'])) echo $_POST['stuff']; //Use $_GET if you're using the GET method instead of POST (not a great idea with textareas)
echo '</textarea>';