INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

history.back()

history.back()

(OP)
Is that possible to detect if a page goes back(history.back()) using javascript?

RE: history.back()

What exactly are you trying to do?  Are you trying to prevent someone going back to avoid accidental submission of the same form twice?  ...or... what?

--Dave

RE: history.back()

(OP)
I have 2 pages, input.asp & error.asp

input.asp has 3 textboxes.  When this page is first loaded, all textboxes are disabled.  They have to enable (press a button) and edit before submit.  

On top of input.asp, error checking is done.  If error(s) is/are found, the page is redirect
response.redirect("error.asp").  

A back button is in error.asp.  So user can go back.  The good thing about the back(history.back() ) is that it retains old values.  I mean those erroneous input.  But the textbox are still disabled.  

How to enable those?..  I mean how to distinguish between page when it is first loaded and page that is (go back) from error.asp?

RE: history.back()

Do you need form elements on the input.asp page to be filled in with the values previously entered?

I am trying all sorts of tests and can't figure out anything right now.  

My instinct, then, is to make your 'back' button on the error.asp page call a function which actually goes forward, calling input.asp with a URL parameter (e.g., document.location = 'input.asp?dis=F';), catch that in the input.asp page and use the BODY tag's onload event to UNDISABLE certain form elements if the URL parameter value was F.

Anyone else?

--Dave

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close