View Full Version : Form input text box that doesn't clear?

10-23-2011, 08:50 PM
Form input text box that doesn't clear?

Hi all

Is it possible to have input text area that doesn't clear when a submit button is pressed.
In this example here - http://www.ttmt.org.uk/form/ if I enter text in the box then click the submit button the text box clears - I want to keep the text in the text box.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>



<form action="" method="" >

<input type="text" name="text" />
<input type="submit" value="Set &rarr;">


10-24-2011, 04:31 PM
This is how the textarea works. If you want to keep the info in the textarea you will need to
1.) use javascript to collect it's contents and re-write it back once form is submitted.
2.) use html5 (which won't work in IE of course). Think its called placeholder (a tag). I did experiment with keeping the text area safe from losing info, but I could find no way to destroy the info from the script. The user had to do it. I didn't like that so never used it on a site.