Forum Moderators: open

Message Too Old, No Replies

Form Field Value Disappear when "go back"...

         

johnlim

3:01 am on Jun 14, 2004 (gmt 0)

10+ Year Member



I have a html form which collects the customer information and the credit card information. It is on a secure page. When the customer filled in the form and submit, the cgi script will validate the field values. If not correct, some messages will be shown on the next page. There is a button using <a href="javascript:history.go(-1)"> Go Back </a>. But when the customer click the Go Back, all the filled-in values of the fields disappear. It is very annoying. But on some browsers, the field values can be kept.

Could Somebody tell me why this happens and how to make it consistent?

Thanks in advance.

BlobFisk

9:20 am on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi johnlim,

The best way of doing this is not to use the history but to do it via a form submission. Using the history can and will result in the loss of the users data - this is what you would expect for security reasons (if I fill in a form and someone comes to my machine and hits back a number of times, I don't want them seeing my CC details!).

Use a form to send the entered details back to the input page, prepopulate the fields and flag where the errors are.

HTH

webhostec

12:07 pm on Jun 14, 2004 (gmt 0)



yes I agree with BlobFisk that you must use form submission instead of history :)

[edited by: BlobFisk at 12:13 pm (utc) on June 14, 2004]
[edit reason] No URLs or Sigs. Please review the TOS. [/edit]