What button do I need to open a new form

Discussion in 'ASP General' started by Krechting, Jan 3, 2004.

  1. Krechting

    Krechting Guest

    Hi All,

    I need a button on my form that opens a new window.
    I put in a submit button but it always returns to my first page.
    And then my first page is empty.
    What button do I need to go to another page (weapon_related)?

    This is what I use at the moment:

    'NewRecord1 Operation Method @3-0C905987
    Sub Operation()
    If NOT ( Visible AND FormSubmitted ) Then Exit Sub

    If FormSubmitted Then
    PressedButton = "Button1"
    If Not IsEmpty(CCGetParam("Button1", Empty)) Then
    PressedButton = "Button1"
    End If
    End If
    session("txtWID")=request("txtWID")
    Redirect = "Weapon_related.asp?" & CCGetQueryString("QueryString",
    Array("ccsForm", "Button1"))
    If Validate() Then
    If PressedButton = "Button1" Then
    If NOT Button1.OnClick() Then
    Redirect = "Weapon_related.asp?" &
    CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
    End If
    End If
    Else
    session("txtWID")=request("txtWID")
    Redirect = "Weapon_related.asp?" &
    CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
    End If
    End Sub

    'End NewRecord1 Operation Method

    Tnx in advance
    Marco
     
    Krechting, Jan 3, 2004
    #1
    1. Advertising

  2. Krechting

    only_me Guest

    Seems to be some confusion here between server side code and client side
    code
    Button1.OnClick() can only run on the client and so cant be in teh same
    code block as " Redirect = "Weapon ..."
    You need to get it clear the separation betwen html/javascript ( and
    VBscript) which can be executed by the browser itself and teh vbscript which
    runs on the server - it does take a while to get your head round but it is
    vital to understanding the intereaction between client ansd server

    In response to your specific question

    In the client HTML code you would define a buton ( not a submit button)
    <input type=button onClick='OpenWindow();' blah blah

    later on the page you would have some javascript like this - you will need
    to further reseach the paramter list supported by the javascript window.open
    command

    <SCRIPT Language="JavaScript">
    <!--
    function OpenWindow()
    {
    url = "your window url here "
    var hWnd = window.open(url,"a__name","here would be a list of parameters
    which define window operation");
    hWnd.focus();
    if (!hWnd.opener)
    hWnd.opener = self;
    }
    // End -->
    </script>

    There are many variations on this theme, but hopefully this should get you
    started


    "Krechting" <> wrote in message
    news:...
    > Hi All,
    >
    > I need a button on my form that opens a new window.
    > I put in a submit button but it always returns to my first page.
    > And then my first page is empty.
    > What button do I need to go to another page (weapon_related)?
    >
    > This is what I use at the moment:
    >
    > 'NewRecord1 Operation Method @3-0C905987
    > Sub Operation()
    > If NOT ( Visible AND FormSubmitted ) Then Exit Sub
    >
    > If FormSubmitted Then
    > PressedButton = "Button1"
    > If Not IsEmpty(CCGetParam("Button1", Empty)) Then
    > PressedButton = "Button1"
    > End If
    > End If
    > session("txtWID")=request("txtWID")
    > Redirect = "Weapon_related.asp?" & CCGetQueryString("QueryString",
    > Array("ccsForm", "Button1"))
    > If Validate() Then
    > If PressedButton = "Button1" Then
    > If NOT Button1.OnClick() Then
    > Redirect = "Weapon_related.asp?" &
    > CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
    > End If
    > End If
    > Else
    > session("txtWID")=request("txtWID")
    > Redirect = "Weapon_related.asp?" &
    > CCGetQueryString("QueryString", Array("ccsForm", "Button1"))
    > End If
    > End Sub
    >
    > 'End NewRecord1 Operation Method
    >
    > Tnx in advance
    > Marco
     
    only_me, Jan 3, 2004
    #2
    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. Microsoft
    Replies:
    1
    Views:
    956
    Steve C. Orr [MVP, MCSD]
    Apr 29, 2005
  2. chandan
    Replies:
    0
    Views:
    977
    chandan
    Nov 17, 2008
  3. slow learner

    How to add "..." button to a property to open up "File Open"?

    slow learner, Aug 25, 2005, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    146
    Steve C. Orr [MVP, MCSD]
    Aug 26, 2005
  4. Gordon
    Replies:
    3
    Views:
    310
    Steven Burn
    Apr 16, 2004
  5. Replies:
    2
    Views:
    468
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page