View Full Version : Go back to asp form via JScript

02-02-2009, 09:54 PM

(Short version:) on a asp page, fill out the form and press submit. It takes you to a thank you page, at that point I want it to go BACk to the form.

(Detailed:) For my work, we have a web based ticket system, and add notes to these via asp pages. I came up with some code to auto file the text, change combo box's then submit itself. Upon submit it takes to a simple "Thank You page" .... after .submit I would like it to go back to the origional "frmAddnote" page. I have tried everything for 2 weeks including:

window.back.... etc with no luck... It just sticks to the "Thank you" page..
I have searched the best I can, and am fluent in VB6 but pretty new to JScript and asp..... Here is my code:

<SCRIPT LANGUAGE = "JavaScript">

//Current window is tpl_pr_addnote.asp
//The form name is frmAddnote

var exwin = external.menuArguments;
var exdoc = exwin.document;
var exobj = exwin.event.srcElement;

exobj.value = exobj.value + "TEST TICKET 020109";

function blockError(){return true;}
window.onerror = blockError;

exdoc.all.namedItem("lstOpenCode").value = "PENDING";
exdoc.all.namedItem("lstActionId").value = "UPDATE";

//submit form (this is the only way I have gotten it to submit)


//This is where the "Thank you" screen comes up and sits like a donkey.
//This is also the location where I have been putting the codes mentioned // above.


Any help or guidence would be greatly appriciated, it's driving me nuts for such a simple move..... Thanks in Advance - Greg :)

02-02-2009, 09:57 PM
I should have mentioned that I am running this code from testfile.js on my local machine.:D

02-02-2009, 10:02 PM
After the Thank You page appears, how about a META-Refresh after a given number of seconds? Try http://en.wikipedia.org/wiki/Meta_refresh on the Thank You page. If the destination page is not always the same, let me know and I'll try to give more help.

02-02-2009, 10:08 PM
Thank you for the quick response. The destination page is in fact diffferent : wcls_pr_AddNoteFinish.asp

The page with the form I want to go BACK to is: tpl_pr_addnote.asp

The reason I want to go back, is because if the user presses "OK" on the "Thank You" page, then they must wait some time, then click on the Add Note button again... I have found that after the user gets the "Thank You" page, if they hit the BACK PAGE (BACKSPACE button in this case) it will take them back to the form and they can add a new note without having to wait to refresh. I hope this makes since, let me know if not.
Cheers - Greg

PS. Also the thing to remember is I have no control over the code on the asp pages... I am running my code from a seperate .js file on my machine that works fine so far... Just want to go back.. lol Basically I want my js file to grab hold of that window and go back or send a BACKSPACE key... either way makes no difference to me...

02-03-2009, 05:22 AM
Everybody's in hot pursuit of beauty 杭州写字楼装潢 (http://www.hzy1.cn)has a greater opportunity, who would not envy? But you know you proud beauty is being taken away and you get some more valuable than the beauty of the thing? To be a test to see if you will lose because of what beautiful.

02-16-2009, 09:09 PM
Just an update that I still haven't figured an answer here... It seems like once I get the form to submit, it loses focus of my code or something.... grrrr there has to be a way.. I have even tried embedding my code in a htm file to see if any difference and there is none... I truns just fine... Just need a simple "Back Page" I can provide the code from the first page if need be, but again I have NO control to change it... Best regards and hope someone will help me with this challenge...