Skip to main content
Inspiring
March 17, 2011
Question

Keep Form Values in Mozilla Browsers after server side validation

  • March 17, 2011
  • 1 reply
  • 676 views

I have a 10 field form that wont keep the form values if the user has an error and has to go back to correct the form.

This appears to be a Mozilla issue only as IE apparently keeps the values.

I tried using  <CFHEADER NAME="cache-control" value=7200> but that does not work.


I also tried <cfform name="form2.cfm" method="post" preservedata="yes">   and that didnt work either.

Example:

Step 1 User completes form1.cfm

Step 2 User submits form1.cfm to form2.cfm and gets this validation error for example


"Your email cannot include yahoo.com. Please go back and choose a different  email address"

I use <a href="javascript:history.go(-1)">go back</a>  to go back


Step 3 User clicks "Go back"

Step 4 Users returns to form and finds that his form data is gone and now needs to start the form all over.


Step 5 User is mad that they need to complete form again.

Is there anything I can do keep the form values?

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    March 17, 2011

    You shouldn't rely on the browser or user behavior -- store the values in a session variable and repopulate the form or post the form back to itself and pull them back out of the form scope.