putting a variable in parameter for a URL

Discussion in 'ASP General' started by ig.martix@gmail.com, Mar 23, 2007.

  1. Guest

    Is it possible to put a variable in parameter for a URL?

    I'm looking to have a page with an input box and a link. When someone
    puts in a value in the input box and clicks the link it will take the
    value and pass it through the link to an asp page.

    example:

    Employee Name <input type="text" name="Tname" size="20">
    <a href="emp_info.asp?e_num= Tname.value">Employee Info </a>

    How can I get this to work??
    , Mar 23, 2007
    #1
    1. Advertising

  2. wrote on 23 Mar 2007 08:12:59 -0700:

    > Is it possible to put a variable in parameter for a URL?
    >
    > I'm looking to have a page with an input box and a link. When someone
    > puts in a value in the input box and clicks the link it will take the
    > value and pass it through the link to an asp page.
    >
    > example:
    >
    > Employee Name <input type="text" name="Tname" size="20">
    > <a href="emp_info.asp?e_num= Tname.value">Employee Info </a>
    >
    > How can I get this to work??


    <form action="emp_info.asp" method="GET">
    <input type="text" name="e_num" size="20">
    <input type="submit" value="Employee Info">
    </form>

    This has nothing to do with ASP, which is server side programming.

    Enter the value in the box, click the Employee Info button, and you'll get
    the URL you want. To use a link such as you have there you'd need some
    client side scripting to take the text value and append it to the URL, but
    the code is pretty trivial.

    Dan
    Daniel Crichton, Mar 23, 2007
    #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. Jimmy Phillips
    Replies:
    2
    Views:
    412
  2. Saurabh
    Replies:
    6
    Views:
    4,504
    Chris Smith
    May 30, 2004
  3. Jeff
    Replies:
    1
    Views:
    1,077
    Toby Inkster
    Dec 11, 2005
  4. Per-Olof Nilsson

    How to aviod putting url-information in history-list.

    Per-Olof Nilsson, Feb 12, 2004, in forum: ASP General
    Replies:
    3
    Views:
    107
  5. Keith
    Replies:
    4
    Views:
    288
    Evertjan.
    Aug 26, 2004
Loading...

Share This Page