Results 1 to 8 of 8

Thread: POST method question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Posts
    80

    Question

    Hi,

    Is there a way to pass a value to an ASP page that expects data from the POST method; i.e. using

    Code:
    MyVal=Request.Form("MyVal")
    without having the SUBMIT button on the preceeding page.

    Basically, I am trying to hide what gets sent to the next page when a regular link is clicked.

    Thanks in advance.

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Why not use the hidden text field

    <INPUT type="hidden" name="myhidden">

    you can then change it's value using javascript

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Posts
    80

    Unhappy but...

    Er..., even with <INPUT type="hidden" name="myhidden">, I still need to have the SUBMIT button on the screen, am I right?

    Is there a way to send the information when a regular link like post hidden info is clicked?

  4. #4
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    yeah you do the followin

    <a href="#" onclick="document.formname.submit();">assa</a>
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  5. #5
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Sorry, I did that wrong

    <a href="document.formname.submit();">Click here</a>
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  6. #6
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    I will get it right.

    <a href="javascript:document.sitesearch.submit();">click here</a>
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Posts
    80

    Talking Thanks

    Thanks Ianpbaker,
    The last one worked.

  8. #8
    Guest
    IP*Works provide server components for ASP, one of which allows you to download a web page to a variable...and it lets you send GET or POST info with the request too.
    If you're cool enough then you'll have it installed on your own server... if not http://www.brinkster.com offer it with their premium membership.

    Alternately do like Ianpbaker suggests...or take it one stage further and send a page back to the browser like:

    Code:
    <html>
      <head>
        <title>Whatever</title>
      </head>
      <body onload="javascript:autoform.submit()">
        <form name="autoform" action="whateverpage.asp" method="post">
          <input type="hidden" name="somevalue" value="blah">
          <input type="hidden" name="someothervalue" value="blah">
          <input type="hidden" name="somethingelseagain" value="more blah">
        </form>
      </body>
    </html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width