Results 1 to 4 of 4

Thread: Passing a parameter to another form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    Ok guys I am counting on you here. I need to pass the contents of a test box to an ASP where it can then query a database. I am trying to do this on a button click but having no success - the story so far:
    <html>

    <head>
    <title>Search</title>
    </head>

    <body>

    <form Name="InputForm" ACTION="default.asp?Customer=Customer" method="POST">
    <div align="center"><center><p><font face="Tahoma">Please enter customer number for
    search&nbsp;&nbsp;&nbsp; </font><input type="text" name="Customer" size="11" maxlength="8"
    value>&nbsp;&nbsp;&nbsp; <input type="submit" value="Search" style="font-family: Tahoma"></p>
    </center></div>
    </form>
    </body>
    </html>

    Should I be doing this in the form tag?
    Should the parameter being passed be inside the quotes?
    HELP!

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi Bigley

    First. get rid of the ?Customer=Customer in the form tag.

    Second. In your default.asp, to get the value back into a variable do

    strCustomer (can be anything you want) = Request.Form("Customer")

    Hope this helps

    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
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323

    sample

    To put it into code it would look like this...

    default.asp -
    Code:
    <form action="submit.asp" method="post">
    <input type="text" name="info"><br>
    <input type="submit" value="Go">
    </form>
    submit.asp -
    Code:
    <%= Request.Form("info")%>
    If you think education is expensive, try ignorance.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    Thanks guys I have it working now.

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