Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Location
    Arizona
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Go back to asp form via JScript

    Greetings.

    (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:

    history.back();
    or
    history.go(-1)
    or
    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)

    exwin.document.forms[0].action="../../bin/files/wcls_pr_AddNoteFinish.asp";
    exwin.document.forms[0].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.



    </SCRIPT>


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

  • #2
    New to the CF scene
    Join Date
    Feb 2009
    Location
    Arizona
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    More info:

    I should have mentioned that I am running this code from testfile.js on my local machine.

  • #3
    Regular Coder
    Join Date
    Jun 2008
    Location
    SE Wisconsin, US
    Posts
    222
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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.
    Milwaukee Web Designer and SEO Milwaukee Firm specializing in ASP.Net, C#, VB.Net, SQL Server and Access.

  • #4
    New to the CF scene
    Join Date
    Feb 2009
    Location
    Arizona
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Last edited by recpack; 02-02-2009 at 10:11 PM.

  • #5
    Banned
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation who would not envy

    Everybody's in hot pursuit of beauty 杭州写字楼装潢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.

  • #6
    New to the CF scene
    Join Date
    Feb 2009
    Location
    Arizona
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Last edited by recpack; 02-16-2009 at 09:13 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •