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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript:history.back()

Status
Not open for further replies.

jcroft

Programmer
Aug 23, 2001
52
0
0
US
I have a page with submit button...OK I submit

error handler below
if status = "Already Ordered" then
select case redisplay
case vendorname = ""
Response.Write "Please click 'Back' and enter Vendor Name"
case vendorname = "Enter Vendor Name"
Response.Write "Please click 'Back' and enter item Vendor Name"
case ordertovendordate = ""
Response.Write "Please click 'Back' and enter Date Ordered"
case howordered = ""
Response.Write "Please click 'Back' and check 'How was order placed:'"
case howordered = "Telephoned" and contact = "Who Took The Order"
Response.Write "Please click 'Back' and enter 'Contact Name:' as well as 'Order Placed By:"
case howordered = "Telephoned" and whoordered = "SFMCO Employee"
Response.Write "Please click 'Back' and enter 'Order Placed By:'"
end select
%><br><a href='javascript:history.back();'>Back</a><%
Response.End
end if

problem...when user goes back, enters new data and submits again the new data is not passed on second submit...

how do I do this?
--only those that do not try, fail--
 
Well that's just not right! ;-)

The browser must be submiting so there is a problem with your logic most likely.

Now... i don't do much javascript these days but that sure doesn't look like any to me :)

-pete
 
ok, maybe I didn't need the javascript forum...I thought the history.back() might be causing the problem,

but thanks for the reply.
--only those that do not try, fail--
 
Yeah, this probably should be posted in an ASP or VBScript forum. Anyhow... try starting a thread there, and then post a link to it in here so we can follow.

You might also want to post the code you have handling the submission so we can see what's going on with the data when submit is pressed; your select case isn't doing anything to the data, so chances are something is happening prior to this if after it is resubmitted it still falls into the select case. --
Jonathan
 
Hi jcroft,

I'm more a vb/asp/cf person myself, but I do know a little about javascript too. The history.back(); function is pretty simple in syntax and function.

Once it sends the browser back to the desired page, it's done. If it sends the user back to a form page and the user clicks the submit button, the browser should submit all form fields.

Your problem is not with the history.back();.

Good luck
Bill

 
Your select case statement is incorrect for one thing
example:
select case redisplay
case &quot;xy&quot;
Response.Write &quot;Please click 'Back' and&quot;
case &quot;xz&quot;
Response......

Note the xy and xz, your syntax of
case vendorname = &quot;Enter Vendor Name&quot;
will not work. Try:
case &quot;Enter Vendor Name&quot;
so long as the variable redisplay could equate to &quot;Enter Vendor Name&quot; .

In addition, the code you are writing should be server side.
Jonathan Galpin
 
nice catch jlgdeveloper,

case vendorname = &quot;Enter Vendor Name&quot;

would be equivalent to

case True


=========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top