html form - retaining input when returning via back button

Associate
Joined
18 Oct 2002
Posts
1,752
Location
Southern England
hi guys,

i've got an html form which a user will complete. i'll validate the input server side as i don't want to use javascript just in case the user has it switched off, and if there are any problems I'm going to inform the user to use their back button and retype the offending information.

Once the user returns to the form I would like it to have retained the informaiton they previously entered. How difficult is this to implement? is it a case of using a header statement to keep the form page from expiring or am i missing something here?

thanks in advance...
 
OK thanks. I'm using php so it's session variables then. I guess when I build the form up I'll check the existance of a session variable for each field and then inject the value into the field.

cheers
 
Robdav said:
if there are any problems I'm going to inform the user to use their back button
If you're using POST that won't work because post data is designed to be sent only once to the server, so if the user goes back they'll get various "I don't want to do it" errors from their browser. Just say "click here" to go back :)

Even better, have the form submit to the same page (ie itself, or display the form again programatically, say you created a showForm() function) so that you can display it again, and simply add the error mesages in red at the top or bottom. No need to go back/forth then :)
 
Back
Top Bottom