javascript poput that passes data

Discussion in 'ASP General' started by Øyvind Isaksen, Apr 4, 2004.

  1. Hi!

    I have an ASP page and with a form, and when the a user clicks the
    submit-buttom the form shall be posted using a popup-script and
    method="get".
    The problem is that when I use a "normal" popup javascript, the formfields
    dont get posted.

    In file2.asp I want the url to be file2.asp?hidden1=value1 (but I only get
    file2.asp without the formfield hidden1)
    I tried to find a newsgroup with html or javascript, but without success.
    Hope someone can help me with a javascript that passes data....


    Thanks!!!


    This is my script:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "',
    'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=4
    00,height=600,left = 476,top = 57');");
    }
    // End -->
    </script>



    <form method ="get">
    <input type="hidden" value="value1" name="hidden1">
    <input type=submit value="Open the Popup Window"
    onClick="javascript:popUp('file2.html')">
    </form>
     
    Øyvind Isaksen, Apr 4, 2004
    #1
    1. Advertising

  2. Øyvind Isaksen

    Evertjan. Guest

    Øyvind Isaksen wrote on 04 apr 2004 in
    microsoft.public.inetserver.asp.general:
    > I have an ASP page and with a form, and when the a user clicks the
    > submit-buttom the form shall be posted using a popup-script and
    > method="get".
    > The problem is that when I use a "normal" popup javascript, the
    > formfields dont get posted.
    >
    > In file2.asp I want the url to be file2.asp?hidden1=value1 (but I only
    > get file2.asp without the formfield hidden1)
    > I tried to find a newsgroup with html or javascript, but without
    > success. Hope someone can help me with a javascript that passes
    > data....
    >
    > This is my script:
    >
    > <SCRIPT LANGUAGE="JavaScript">
    > <!-- Begin
    > function popUp(URL) {
    > day = new Date();
    > id = day.getTime();
    > eval("page" + id + " = window.open(URL, '" + id + "',
    > 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,wi
    > dth=4 00,height=600,left = 476,top = 57');");
    >}
    > // End -->
    > </script>
    >
    > <form method ="get">
    > <input type="hidden" value="value1" name="hidden1">
    > <input type=submit value="Open the Popup Window"
    > onClick="javascript:popUp('file2.html')">
    > </form>


    This has nothing to do with serverside ASP.

    Please ask a javascript NG.

    [ btw: eval is evil ]


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Apr 4, 2004
    #2
    1. Advertising

  3. Øyvind Isaksen

    Matt Foster Guest

    Try this:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "',
    'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=4
    00,height=600,left = 476,top = 57');");
    }
    // End -->
    </script>



    <form method ="get" action="javascript:popUp('file2.html')">
    <input type="hidden" value="value1" name="hidden1">
    <input type=submit value="Open the Popup Window">
    </form>
     
    Matt Foster, Apr 4, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    3
    Views:
    2,871
    OHM \( One Handed Man \)
    Apr 9, 2006
  2. Terry Jones
    Replies:
    3
    Views:
    851
    Nick Kew
    Mar 24, 2005
  3. =?ISO-8859-1?Q?Morris_Carr=E9?=

    Python passes the Turing test with a one-liner !

    =?ISO-8859-1?Q?Morris_Carr=E9?=, Apr 1, 2004, in forum: Python
    Replies:
    1
    Views:
    358
    Jon Perez
    Apr 2, 2004
  4. magister pips
    Replies:
    1
    Views:
    1,224
    =?Utf-8?B?TmF0aGFuaWVsIEdyZWVuZQ==?=
    Aug 24, 2007
  5. magister pips
    Replies:
    1
    Views:
    306
    John Saunders [MVP]
    Aug 24, 2007
Loading...

Share This Page