Open a window.

Discussion in 'ASP General' started by n2K, Feb 14, 2005.

  1. n2K

    n2K Guest

    Hello to all. I would like to open a new window (Function is called
    NewWindow and is writtent in VBscript) when a user submits a form. All the
    samples I found on the web indicate something like the following:

    <%@ Language=VBScript %>
    <html>
    <head>
    </head>
    <body>

    <script language="javascript">

    function NewWindow()
    NewWindow = window.open
    ("Slider.asp","progress","toolbar=no,scrollbars=no,width=200,height=150,menubar=no,location=no,resizable=no");
    end function

    </script>

    <form enctype="multipart/form-data" action="SomeASPpage.asp" method="post"
    name="main1" onsubmit = NewWindow()>
    <input name="file" type="file" size="50">
    <INPUT type="text" id=text1 name=text1><INPUT type="text" id=text2
    name=text2>
    <input name="submit" type="submit" value="Do It">
    </form>
    </body>
    </html>

    What am I doing wrong? I've even tried RETURN NEWWINDOW() after ONSUBMIT.
    (Okay, it's probably not close - but I am new at this).

    TX...
     
    n2K, Feb 14, 2005
    #1
    1. Advertising

  2. n2K

    n2K Guest

    Quite right, it is client side. I'm not sure what you mean by form.submit()
    in the Function's event? In addition, do I remove the SUBMIT button in my
    form/

    thanks

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:%...
    > are you expecting this to open before you post back?
    > If so, have your button NOT be a submit, have it call the function, then
    > do a form.submit() in it's event.
    > This is all clientside though, and not ASP related.
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "n2K" <> wrote in message
    > news:%...
    >> Hello to all. I would like to open a new window (Function is called
    >> NewWindow and is writtent in VBscript) when a user submits a form. All
    >> the samples I found on the web indicate something like the following:
    >>
    >> <%@ Language=VBScript %>
    >> <html>
    >> <head>
    >> </head>
    >> <body>
    >>
    >> <script language="javascript">
    >>
    >> function NewWindow()
    >> NewWindow = window.open
    >>
    >> ("Slider.asp","progress","toolbar=no,scrollbars=no,width=200,height=150,menubar=no,location=no,resizable=no");
    >> end function
    >>
    >> </script>
    >>
    >> <form enctype="multipart/form-data" action="SomeASPpage.asp"
    >> method="post" name="main1" onsubmit = NewWindow()>
    >> <input name="file" type="file" size="50">
    >> <INPUT type="text" id=text1 name=text1><INPUT type="text" id=text2
    >> name=text2>
    >> <input name="submit" type="submit" value="Do It">
    >> </form>
    >> </body>
    >> </html>
    >>
    >> What am I doing wrong? I've even tried RETURN NEWWINDOW() after ONSUBMIT.
    >> (Okay, it's probably not close - but I am new at this).
    >>
    >> TX...
    >>
    >>
    >>

    >
    >
     
    n2K, Feb 14, 2005
    #2
    1. Advertising

  3. n2K

    Mark Schupp Guest

    This is client-side and would be better asked on a client-side group. Here
    are a few comments however:

    First of all you have set language="javascript" in the script tags but you
    are using vbscript (get in the habit of using javascript client-side if you
    can).

    Do you want the form to submit whether popup window succeeds or not? If so
    return "true" from your NewWindow() function. You are currently returning
    the window handle or the new window.

    Does the form submit and processing work properly if you leave out the
    "onsubmit=" attribute. If not what error do you get?

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "n2K" <> wrote in message
    news:%...
    > Hello to all. I would like to open a new window (Function is called
    > NewWindow and is writtent in VBscript) when a user submits a form. All the
    > samples I found on the web indicate something like the following:
    >
    > <%@ Language=VBScript %>
    > <html>
    > <head>
    > </head>
    > <body>
    >
    > <script language="javascript">
    >
    > function NewWindow()
    > NewWindow = window.open
    >

    ("Slider.asp","progress","toolbar=no,scrollbars=no,width=200,height=150,menu
    bar=no,location=no,resizable=no");
    > end function
    >
    > </script>
    >
    > <form enctype="multipart/form-data" action="SomeASPpage.asp" method="post"
    > name="main1" onsubmit = NewWindow()>
    > <input name="file" type="file" size="50">
    > <INPUT type="text" id=text1 name=text1><INPUT type="text" id=text2
    > name=text2>
    > <input name="submit" type="submit" value="Do It">
    > </form>
    > </body>
    > </html>
    >
    > What am I doing wrong? I've even tried RETURN NEWWINDOW() after ONSUBMIT.
    > (Okay, it's probably not close - but I am new at this).
    >
    > TX...
    >
    >
    >
     
    Mark Schupp, Feb 14, 2005
    #3
  4. n2K

    n2K Guest

    Good points about Javascript. Again, in the learning phasse, but I'm getting
    there.

    Yes, the form works correcly without the onsubmit. The idea here is that I'm
    trying to determine the size of a file that I want to pass to the ASP script
    that uses a COM HTTP (asptypelibrary) component. I utlimately want to
    display a progress bar. However, with the AspTypeLib, you cannot access the
    form object once you're instansiated the component. A little confusing as I
    know COM, but not reall "Snuffy" about ASP etc.

    But I do thank you for the pointers and assist.

    "Mark Schupp" <> wrote in message
    news:uS8MA%...
    > This is client-side and would be better asked on a client-side group. Here
    > are a few comments however:
    >
    > First of all you have set language="javascript" in the script tags but you
    > are using vbscript (get in the habit of using javascript client-side if
    > you
    > can).
    >
    > Do you want the form to submit whether popup window succeeds or not? If so
    > return "true" from your NewWindow() function. You are currently returning
    > the window handle or the new window.
    >
    > Does the form submit and processing work properly if you leave out the
    > "onsubmit=" attribute. If not what error do you get?
    >
    > --
    > Mark Schupp
    > Head of Development
    > Integrity eLearning
    > www.ielearning.com
    >
    >
    > "n2K" <> wrote in message
    > news:%...
    >> Hello to all. I would like to open a new window (Function is called
    >> NewWindow and is writtent in VBscript) when a user submits a form. All
    >> the
    >> samples I found on the web indicate something like the following:
    >>
    >> <%@ Language=VBScript %>
    >> <html>
    >> <head>
    >> </head>
    >> <body>
    >>
    >> <script language="javascript">
    >>
    >> function NewWindow()
    >> NewWindow = window.open
    >>

    > ("Slider.asp","progress","toolbar=no,scrollbars=no,width=200,height=150,menu
    > bar=no,location=no,resizable=no");
    >> end function
    >>
    >> </script>
    >>
    >> <form enctype="multipart/form-data" action="SomeASPpage.asp"
    >> method="post"
    >> name="main1" onsubmit = NewWindow()>
    >> <input name="file" type="file" size="50">
    >> <INPUT type="text" id=text1 name=text1><INPUT type="text" id=text2
    >> name=text2>
    >> <input name="submit" type="submit" value="Do It">
    >> </form>
    >> </body>
    >> </html>
    >>
    >> What am I doing wrong? I've even tried RETURN NEWWINDOW() after ONSUBMIT.
    >> (Okay, it's probably not close - but I am new at this).
    >>
    >> TX...
    >>
    >>
    >>

    >
    >
     
    n2K, Feb 15, 2005
    #4
  5. n2K

    n2K Guest

    Sorry Mark, I should be a little more explanative.

    Want I want to do is to start my Progress Bar BEFORE I submit the form. So
    my thunkin was that I could use the onsubmit to call a function. The
    function determines the file size using filescripting, then starts my pbar
    (my pbar needs the incriment value which I calculate from the file size),
    THEN submit the form to my asp script.

    Obvisouly, not there yet.

    "Mark Schupp" <> wrote in message
    news:uS8MA%...
    > This is client-side and would be better asked on a client-side group. Here
    > are a few comments however:
    >
    > First of all you have set language="javascript" in the script tags but you
    > are using vbscript (get in the habit of using javascript client-side if
    > you
    > can).
    >
    > Do you want the form to submit whether popup window succeeds or not? If so
    > return "true" from your NewWindow() function. You are currently returning
    > the window handle or the new window.
    >
    > Does the form submit and processing work properly if you leave out the
    > "onsubmit=" attribute. If not what error do you get?
    >
    > --
    > Mark Schupp
    > Head of Development
    > Integrity eLearning
    > www.ielearning.com
    >
    >
    > "n2K" <> wrote in message
    > news:%...
    >> Hello to all. I would like to open a new window (Function is called
    >> NewWindow and is writtent in VBscript) when a user submits a form. All
    >> the
    >> samples I found on the web indicate something like the following:
    >>
    >> <%@ Language=VBScript %>
    >> <html>
    >> <head>
    >> </head>
    >> <body>
    >>
    >> <script language="javascript">
    >>
    >> function NewWindow()
    >> NewWindow = window.open
    >>

    > ("Slider.asp","progress","toolbar=no,scrollbars=no,width=200,height=150,menu
    > bar=no,location=no,resizable=no");
    >> end function
    >>
    >> </script>
    >>
    >> <form enctype="multipart/form-data" action="SomeASPpage.asp"
    >> method="post"
    >> name="main1" onsubmit = NewWindow()>
    >> <input name="file" type="file" size="50">
    >> <INPUT type="text" id=text1 name=text1><INPUT type="text" id=text2
    >> name=text2>
    >> <input name="submit" type="submit" value="Do It">
    >> </form>
    >> </body>
    >> </html>
    >>
    >> What am I doing wrong? I've even tried RETURN NEWWINDOW() after ONSUBMIT.
    >> (Okay, it's probably not close - but I am new at this).
    >>
    >> TX...
    >>
    >>
    >>

    >
    >
     
    n2K, Feb 15, 2005
    #5
    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. ml
    Replies:
    0
    Views:
    1,493
  2. ml
    Replies:
    2
    Views:
    4,900
    John C. Bollinger
    Nov 30, 2004
  3. wax
    Replies:
    9
    Views:
    366
  4. Clare Hsiao
    Replies:
    11
    Views:
    273
    Michael Winter
    Feb 13, 2004
  5. PC HUA
    Replies:
    2
    Views:
    471
    PC HUA
    May 19, 2004
Loading...

Share This Page