Jump to content

problem in using history.back()


Recommended Posts

 

thanks for your reply. my problem is, I have designed a form which takes data like name, contact number, e-mail etc from users. if users enter wrong e-mail and submit the form, it validates the form data and gives "back" link to correct wrongly entered data.

Incorrect e-Mail address. Please go <a href="javascript:history.back();">back</a> and enter the e-Mail address correctly

 

when i click the "back" link, all of the form data was gone. how can i make retain the form data when clicked the back link.

 

data is retained when going through browser's back button. but not with javascript:history.back method

 

any ides??

 

 

thanks again.

this is not really a javascript issue what you really need is serverside validation. when certain fields are empty or incorrect you should retrieve the posted data and show the form again. this is php related.

 

you can validate your form using javascript however you should always use serverside validation and javascript to create a more user friendly experience. look up php form validation tutorials

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.