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!

can anyone explain a problem I'm having with the back button on my asp

Status
Not open for further replies.

countrygirl35

Programmer
May 13, 2008
4
US
My asp page gets a value from a text box for a zip code on the first page and on the process page it checks those values against an sql table to make sure the zip code field is valid. My problem is that sometimes when the user clicks the back button to correct the zip code field the data is gone. Has anyone out there experienced this problem or do you know how to correct it?
 
Are they clicking back in the browser or clicking some sort of back button you have provided?

I would guess you would want a set up where the information is entered, a database run is made to check the zip code, and then the processing returns to a prepopulated form where the offending value is highlighted if one is found or to an acknowledgement/next stage if no offenses are detected. Nothing involving a back button.

Perhaps you could say a little more about your process/application and how the data is being handled.
 
I am using the javascript history command to go back to the first page automatically if the error condition exists. (The zip code not being found in the table)
 
I don't think you want to use Javascript to do that. I don't think it will behave consistently.

I use Javascript to do some minor client side validation on a form I'm working on now, but I haven't done server side validation which is what I think you are talking about.

I'm going to go read this article:

"Using ASP for Form Handling: Part 2 - Server Side Form-Field Validation"

and that is my best suggestion to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top