Forum Moderators: open

Message Too Old, No Replies

Retaining text fields after submittal

         

ayudame

1:37 pm on Jul 24, 2003 (gmt 0)

10+ Year Member



I'm not too smart with HTML forms and such but my problem is as follows. I have a form setup for where when some fields are not filled out it gives an error message and directs the user to click the back button to fill in the correct information. However when the user clicks the back button all the information that was previously typed in other text boxes is deleted. Is there a way to have the text they just typed stay in those boxes when they click the back button?

Thanks

smokin

1:47 pm on Jul 24, 2003 (gmt 0)

10+ Year Member



Hi, imho if you are not using server side scripting to validate your form inputs then you should do you all validation on the form page when the user clicks the submit button. This way the form will not be submitted until all form inputs have been validated.

ayudame

2:06 pm on Jul 24, 2003 (gmt 0)

10+ Year Member



Could you explain how to do that or direct me to a page that would explain how? Thank you.

smokin

2:25 pm on Jul 24, 2003 (gmt 0)

10+ Year Member



ok,first off could you show me the code you are using to do validation?

ayudame

6:11 pm on Jul 25, 2003 (gmt 0)

10+ Year Member



I found a java script that did the trick pretty well.. the code was at: [farnham-pfile.com...]

But thanks for your help.

vincevincevince

11:51 am on Jul 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i always use php and have value=$_REQUEST['fieldname'] for the default values - that way php will pass back the previously filled values on refresh