Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form auto submits

Status
Not open for further replies.

Jeremy21b

Technical User
Jul 7, 2002
127
CA
When someone clicks on a button on my page, it goes to another page that does some parsing and then autosubmits a form. This takes them to a new page. This works fine, unless they click back. Then they get to the page that just autosubmits a form. The page says: 'warning: page has expired'. Then if they do refresh, it just autosubmits the form. To get back to where they really want to go, they would have to click back twice. So how can I get around this?
 
One way would be to set a conditional on the middle (autosubmit) page that would check to make sure it is coming from the first page and, if so, then autosubmit, else send it back to the first page. Something akin to (you may need to tweak for your purposes):
Code:
if request("firstSubmitButton") [COLOR=green]'this is the submit button from the first page.[/color]
 [COLOR=blue]'Do whatever you would normally do and then autosubmit.[/color]
else [COLOR=green]'if it is not coming from that first page.[/color]
 response.redirect("FirstPage.asp")
end if

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
After thinking about that for a moment, it occurs to me that the above may not work as it when using the Back button on the browser that the page doesn't necessarily re-process and therefore it won't get read that. Hmmm... Not entirely sure of a valid answer here...

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
Yeah I was going to try a conditional statement similar to that, but didn't think it would process. I think I might be stuck rethinking the entire logic and trying to eliminate that middle page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top