SA Developer .NET

Welcome to SA Developer .NET Sign in | Join | Help
in Search

Submitting forms using javascript

Last post 07-15-2008, 14:36 by horatio. 1 replies.
Sort Posts: Previous Next
  •  07-15-2008, 13:45 13374

    Submitting forms using javascript

    Hi all,

    I'm working on a project where I have to modify a pop-up menu to disable the address bar on loading of the pop-up. I know I could use "window.open()" but unfortunately I can't for various reasons (the way the JSP site is programmed). The forwarding is done as follows:

    document.form1.action = <web_address_generated_by_code>

    document.form1.target = "new";

    document.form1.submit();

    Now, is there any way I can modify this code to allow me to disable the address bar when the submit() is being done.

    Thank loads guys/gals!!!!


    The Question is the Answer, and the Answer is the Question!
  •  07-15-2008, 14:36 13376 in reply to 13374

    Re: Submitting forms using javascript

    horatio:

    Hi all,

    I'm working on a project where I have to modify a pop-up menu to disable the address bar on loading of the pop-up. I know I could use "window.open()" but unfortunately I can't for various reasons (the way the JSP site is programmed). The forwarding is done as follows:

    document.form1.action = <web_address_generated_by_code>

    document.form1.target = "new";

    document.form1.submit();

    Now, is there any way I can modify this code to allow me to disable the address bar when the submit() is being done.

    Thank loads guys/gals!!!!

    Got it!!!!!!!!!!!

    To open a popup window using javascript's document DOM object, do the following:

    document.form1.action = <web_address_generated_by_code>

    var printWin = window.open(<web_address_generated_by_code>, "print", "toolbar=0;scrollbars=0 etc. etc.");

    document.form1.target = "print"; //Name of window given in window.open() statement.

    document.form1.submit();

    This will open a new window in the browser (IE for sure) with the address bar hidden (pre IE7) or disabled (IE7+). Will test this on FireFox as well.

    P.S. I would never do something like this myself. It's just I had to do it this way because a normal window.open(); caused errors because of the architecture the site was using (a JAVA/JSP version of MVC).

    Hope this can help someone else too!!!!!!!!!!!! Big Smile


    The Question is the Answer, and the Answer is the Question!
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems