Submit form using method="post" to target="_search"

Discussion in 'ASP General' started by Rui Pestana, Nov 19, 2003.

  1. Rui Pestana

    Rui Pestana Guest

    Hello all,

    I want to use the POST method to submit the form and then grab the
    parameters in the asp file with request.form("parm").

    The problem is that I am using the _search target to open the asp
    page.
    When I use _blank target there is no problem, either I use GET or POST
    method.
    But when I use _search target, only GET method works.

    I really need to use POST method cause I'm passing lot of data in the
    parameters.

    Thanks a lot in advance for any suggestion, solution, reasons why this
    doesn't work or a workaround.

    Rui


    ***********************************************
    ***************FILE a.htm**********************
    ***********************************************

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    </head>

    <body>
    <form name="frmGo" action="b.asp" method="post" target="_search">
    <input type="text" name="parm" value="olaParm">
    <input type="hidden" name="parmHidden" value="olaParmHidden">
    </form>
    <a href='javascript:frmGo.submit()'>Go (POST)... </a>

    <form name="frmGo1" action="b.asp" method="get" target="_search">
    <input type="text" name="parm" value="olaParm">
    <input type="hidden" name="parmHidden" value="olaParmHidden">
    </form>
    <a href='javascript:frmGo1.submit()'>Go (GET)... </a>

    </body>
    </html>

    ***********************************************
    ***************FILE b.asp**********************
    ***********************************************

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    </head>

    <body>
    POST<br>
    parm:<input type="text" name="parm" value="<%= request.form("parm")
    %>"> <br>
    parmHidden:<input type="text" name="parmHidden" value="<%=
    request.form("parmHidden") %>"> <br>

    GET<br>
    parm:<input type="text" name="parm" value="<%=
    request.QueryString("parm") %>"> <br>
    parmHidden:<input type="text" name="parmHidden" value="<%=
    request.QueryString("parmHidden") %>"> <br>
    </body>
    </html>
     
    Rui Pestana, Nov 19, 2003
    #1
    1. Advertising

  2. Rui Pestana

    Steven Burn Guest

    I'm using frames and the POST method, and it works just fine?

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)

    Rui Pestana <> wrote in message
    news:...
    > Hello all,
    >
    > I want to use the POST method to submit the form and then grab the
    > parameters in the asp file with request.form("parm").
    >
    > The problem is that I am using the _search target to open the asp
    > page.
    > When I use _blank target there is no problem, either I use GET or POST
    > method.
    > But when I use _search target, only GET method works.
    >
    > I really need to use POST method cause I'm passing lot of data in the
    > parameters.
    >
    > Thanks a lot in advance for any suggestion, solution, reasons why this
    > doesn't work or a workaround.
    >
    > Rui
    >
    >
    > ***********************************************
    > ***************FILE a.htm**********************
    > ***********************************************
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <html>
    > <head>
    > <title>Untitled Document</title>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    > </head>
    >
    > <body>
    > <form name="frmGo" action="b.asp" method="post" target="_search">
    > <input type="text" name="parm" value="olaParm">
    > <input type="hidden" name="parmHidden" value="olaParmHidden">
    > </form>
    > <a href='javascript:frmGo.submit()'>Go (POST)... </a>
    >
    > <form name="frmGo1" action="b.asp" method="get" target="_search">
    > <input type="text" name="parm" value="olaParm">
    > <input type="hidden" name="parmHidden" value="olaParmHidden">
    > </form>
    > <a href='javascript:frmGo1.submit()'>Go (GET)... </a>
    >
    > </body>
    > </html>
    >
    > ***********************************************
    > ***************FILE b.asp**********************
    > ***********************************************
    >
    > <%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
    > <html>
    > <head>
    > <title>Untitled Document</title>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    > </head>
    >
    > <body>
    > POST<br>
    > parm:<input type="text" name="parm" value="<%= request.form("parm")
    > %>"> <br>
    > parmHidden:<input type="text" name="parmHidden" value="<%=
    > request.form("parmHidden") %>"> <br>
    >
    > GET<br>
    > parm:<input type="text" name="parm" value="<%=
    > request.QueryString("parm") %>"> <br>
    > parmHidden:<input type="text" name="parmHidden" value="<%=
    > request.QueryString("parmHidden") %>"> <br>
    > </body>
    > </html>
     
    Steven Burn, Nov 19, 2003
    #2
    1. Advertising

  3. Rui Pestana

    Adrienne Guest

    Gazing into my crystal ball I observed (Rui
    Pestana) writing in news::

    > Hello all,
    >
    > I want to use the POST method to submit the form and then grab the
    > parameters in the asp file with request.form("parm").
    >
    > The problem is that I am using the _search target to open the asp
    > page.
    > When I use _blank target there is no problem, either I use GET or POST
    > method.
    > But when I use _search target, only GET method works.
    >
    > I really need to use POST method cause I'm passing lot of data in the
    > parameters.
    >
    > Thanks a lot in advance for any suggestion, solution, reasons why this
    > doesn't work or a workaround.
    >
    > Rui
    >
    >
    > ***********************************************
    > ***************FILE a.htm**********************
    > ***********************************************
    >
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
    ><head> <title>Untitled Document</title> <meta http-equiv="Content-Type"
    > content="text/html; charset=iso-8859-1"> </head>
    >
    ><body>
    > <form name="frmGo" action="b.asp" method="post" target="_search">
    > <input type="text" name="parm" value="olaParm">
    > <input type="hidden" name="parmHidden" value="olaParmHidden">
    > </form>
    > <a href='javascript:frmGo.submit()'>Go (POST)... </a>
    >
    > <form name="frmGo1" action="b.asp" method="get" target="_search">
    > <input type="text" name="parm" value="olaParm">
    > <input type="hidden" name="parmHidden" value="olaParmHidden">
    > </form>
    > <a href='javascript:frmGo1.submit()'>Go (GET)... </a>
    >
    ></body>
    ></html>
    >
    > ***********************************************
    > ***************FILE b.asp**********************
    > ***********************************************
    >
    ><%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%> <html> <head>
    ><title>Untitled Document</title> <meta http-equiv="Content-Type"
    > content="text/html; charset=iso-8859-1"> </head>
    >
    ><body>
    > POST<br>
    > parm:<input type="text" name="parm" value="<%= request.form("parm")
    > %>"> <br>
    > parmHidden:<input type="text" name="parmHidden" value="<%=
    > request.form("parmHidden") %>"> <br>
    >
    > GET<br>
    > parm:<input type="text" name="parm" value="<%=
    > request.QueryString("parm") %>"> <br>
    > parmHidden:<input type="text" name="parmHidden" value="<%=
    > request.QueryString("parmHidden") %>"> <br>
    ></body>
    ></html>
    >


    target="_blank" is a reserved word. target="_search" will open in a window
    called _search, if one is not available, it will create that window. Be
    aware that some pop-up stoppers and/or browser configurations may cause the
    window not to open.

    Additionally, <a href="javascript:frmGo.submit()"> is malformed. It will
    not work in many browsers, Opera for example. You should be using <input
    type="submit" onclick="frmGo.submit()"> This will enable users without
    javascript to still submit the page, and you can do server side
    verification.


    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
     
    Adrienne, Nov 19, 2003
    #3
  4. Rui Pestana

    Guest Guest

    Why do you need "_search"?

    >-----Original Message-----
    >Hello all,
    >
    >I want to use the POST method to submit the form and then

    grab the
    >parameters in the asp file with request.form("parm").
    >
    >The problem is that I am using the _search target to open

    the asp
    >page.
    >When I use _blank target there is no problem, either I

    use GET or POST
    >method.
    >But when I use _search target, only GET method works.
    >
    >I really need to use POST method cause I'm passing lot of

    data in the
    >parameters.
    >
    >Thanks a lot in advance for any suggestion, solution,

    reasons why this
    >doesn't work or a workaround.
    >
    >Rui
    >
    >
    >***********************************************
    >***************FILE a.htm**********************
    >***********************************************
    >
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

    Transitional//EN">
    ><html>
    ><head>
    ><title>Untitled Document</title>
    ><meta http-equiv="Content-Type" content="text/html;
    >charset=iso-8859-1">
    ></head>
    >
    ><body>
    > <form name="frmGo" action="b.asp" method="post"

    target="_search">
    > <input type="text" name="parm"

    value="olaParm">
    > <input type="hidden" name="parmHidden"

    value="olaParmHidden">
    > </form>
    > <a href='javascript:frmGo.submit()'>Go (POST)...

    </a>
    >
    > <form name="frmGo1" action="b.asp" method="get"

    target="_search">
    > <input type="text" name="parm"

    value="olaParm">
    > <input type="hidden" name="parmHidden"

    value="olaParmHidden">
    > </form>
    > <a href='javascript:frmGo1.submit()'>Go (GET)...

    </a>
    >
    ></body>
    ></html>
    >
    >***********************************************
    >***************FILE b.asp**********************
    >***********************************************
    >
    ><%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
    ><html>
    ><head>
    ><title>Untitled Document</title>
    ><meta http-equiv="Content-Type" content="text/html;
    >charset=iso-8859-1">
    ></head>
    >
    ><body>
    >POST<br>
    >parm:<input type="text" name="parm" value="<%=

    request.form("parm")
    >%>"> <br>
    >parmHidden:<input type="text" name="parmHidden" value="<%=
    >request.form("parmHidden") %>"> <br>
    >
    >GET<br>
    >parm:<input type="text" name="parm" value="<%=
    >request.QueryString("parm") %>"> <br>
    >parmHidden:<input type="text" name="parmHidden" value="<%=
    >request.QueryString("parmHidden") %>"> <br>
    ></body>
    ></html>
    >.
    >
     
    Guest, Nov 19, 2003
    #4
  5. Rui Pestana

    Rui Pestana Guest

    I need to use the _search frame, to keep user in the some page. In fact,
    I don't really need the search capabalities of this frame.
    I want to update a record in the _search frame and then refresh the main
    page.
    Using the _search frame it's be possible to refresh the _main page to
    reflect the changes made.

    I have this working when I use Get method. But now I need to use Post
    method because of size string restrictions when using Get method.

    Thanks and regards

    Rui

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Rui Pestana, Nov 20, 2003
    #5
  6. Rui Pestana

    Rui Pestana Guest

    Adrienne
    thanks for the answer...

    But, the issue is to grab "parm" value in the asp file:

    <input type="text" name="parm" value="<%= request.form("parm")> %>">

    after passing it using

    <form name="frmGo" action="b.asp" method="post" target="_search">
    <input type="text" name="parm" value="olaParm">
    <input type="submit" onclick="frmGo.submit()">
    </form>

    I really appreciate if you have a solution to this
    Thanks
    Rui

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Rui Pestana, Nov 20, 2003
    #6
  7. Rui Pestana

    Steven Burn Guest

    What exactly happens when you use the POST method?

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)

    Rui Pestana <> wrote in message
    news:...
    > I need to use the _search frame, to keep user in the some page. In fact,
    > I don't really need the search capabalities of this frame.
    > I want to update a record in the _search frame and then refresh the main
    > page.
    > Using the _search frame it's be possible to refresh the _main page to
    > reflect the changes made.
    >
    > I have this working when I use Get method. But now I need to use Post
    > method because of size string restrictions when using Get method.
    >
    > Thanks and regards
    >
    > Rui
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Steven Burn, Nov 20, 2003
    #7
  8. Rui Pestana

    Rui Pestana Guest

    I just can't get the parameter...

    "Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message news:<>...
    > What exactly happens when you use the POST method?
    >
    > --
    >
    > Regards
    >
    > Steven Burn
    > Ur I.T. Mate Group
    > www.it-mate.co.uk
    >
    > Keeping it FREE!
    >
    > Disclaimer:
    > I know I'm probably wrong, I just like taking part ;o)
    >
    > Rui Pestana <> wrote in message
    > news:...
    > > I need to use the _search frame, to keep user in the some page. In fact,
    > > I don't really need the search capabalities of this frame.
    > > I want to update a record in the _search frame and then refresh the main
    > > page.
    > > Using the _search frame it's be possible to refresh the _main page to
    > > reflect the changes made.
    > >
    > > I have this working when I use Get method. But now I need to use Post
    > > method because of size string restrictions when using Get method.
    > >
    > > Thanks and regards
    > >
    > > Rui
    > >
    > > *** Sent via Developersdex http://www.developersdex.com ***
    > > Don't just participate in USENET...get rewarded for it!
     
    Rui Pestana, Nov 24, 2003
    #8
    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. David Adams

    Change target of form AFTER submit

    David Adams, Jun 6, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    5,251
    David Adams
    Jun 6, 2006
  2. Pealy
    Replies:
    2
    Views:
    171
    Pealy
    Apr 23, 2004
  3. marc
    Replies:
    1
    Views:
    124
    Thomas 'PointedEars' Lahn
    Jan 11, 2006
  4. Replies:
    0
    Views:
    817
  5. Replies:
    3
    Views:
    701
Loading...

Share This Page