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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.