use client side code to trigger the load of page must use GET Protocol?

Discussion in 'ASP General' started by Matt, Jan 18, 2004.

  1. Matt

    Matt Guest

    The following code is the drop down box, and when user changes the
    selection, it will display the value of the selection automatically by the
    onchange event. This code works fine with GET Protocol.

    <html>
    <body>
    <form name="eventform" action="eventtest3.asp" method="GET">
    <select name="id" onchange="location.href='eventtest3.asp?id='+this.value">
    <option value="select">select</option>
    <option value="1001">1001</option>
    <option value="1002">1002</option>
    <option value="1003">1003</option>
    </select>
    <%= Request.Querystring("id") %>
    </form>
    </body>
    </html>

    However, if I use POST protocol, it doesn't work anymore.

    <html>
    <body>
    <form name="eventform" action="eventtest4.asp" method="POST">
    <select name="id" onchange="location.href='eventtest4.asp'">
    <option value="select">select</option>
    <option value="1001">1001</option>
    <option value="1002">1002</option>
    <option value="1003">1003</option>
    </select>
    <%= Request.Form("id") %>
    </form>
    </body>
    </html>

    My question is: do we need to use GET protocol to trigger the reload of the
    page?? Can I use POST protocol to accomplish the same task??


    Please advise. Thanks!
    Matt, Jan 18, 2004
    #1
    1. Advertising

  2. Matt

    Brynn Guest

    Even with the GET protocol ... you are not submitting the form in
    either example.

    You are not getting the GET one because of submission, you are getting
    it because it is in the link ... that's all ... the form is not doing
    anything.

    what you want to do in EACH form is have ....

    <select name="id" onchange="document.eventform.submit()">

    placing this line in each sample should make both of them work. The
    querystring for the first will be built by the form submission.

    Brynn
    www.coolpier.com


    On Sat, 17 Jan 2004 19:29:14 -0800, "Matt" <>
    wrote:

    >The following code is the drop down box, and when user changes the
    >selection, it will display the value of the selection automatically by the
    >onchange event. This code works fine with GET Protocol.
    >
    ><html>
    ><body>
    ><form name="eventform" action="eventtest3.asp" method="GET">
    > <select name="id" onchange="location.href='eventtest3.asp?id='+this.value">
    > <option value="select">select</option>
    > <option value="1001">1001</option>
    > <option value="1002">1002</option>
    > <option value="1003">1003</option>
    > </select>
    ><%= Request.Querystring("id") %>
    ></form>
    ></body>
    ></html>
    >
    >However, if I use POST protocol, it doesn't work anymore.
    >
    ><html>
    ><body>
    ><form name="eventform" action="eventtest4.asp" method="POST">
    > <select name="id" onchange="location.href='eventtest4.asp'">
    > <option value="select">select</option>
    > <option value="1001">1001</option>
    > <option value="1002">1002</option>
    > <option value="1003">1003</option>
    > </select>
    ><%= Request.Form("id") %>
    ></form>
    ></body>
    ></html>
    >
    >My question is: do we need to use GET protocol to trigger the reload of the
    >page?? Can I use POST protocol to accomplish the same task??
    >
    >
    >Please advise. Thanks!
    >
    >
    >


    I participate in the group to help give examples of code. I do not guarantee the effects of any code posted. Test all code before use!

    Brynn
    www.coolpier.com
    Brynn, Jan 18, 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. Fred
    Replies:
    2
    Views:
    1,058
    Craig Deelsnyder
    Jul 12, 2004
  2. nick
    Replies:
    3
    Views:
    3,160
    Eliyahu Goldin
    Dec 15, 2004
  3. Replies:
    1
    Views:
    890
    Sudsy
    Dec 8, 2004
  4. Replies:
    1
    Views:
    701
    Norman Yuan
    Mar 22, 2007
  5. Bogdan
    Replies:
    2
    Views:
    634
    Bogdan
    Jun 9, 2008
Loading...

Share This Page