IIS ASP - putting a variable in parameter for a URL

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2007 > putting a variable in parameter for a URL





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author putting a variable in parameter for a URL
ig.martix@gmail.com

2007-03-23, 1:22 pm

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??

Daniel Crichton

2007-03-23, 1:22 pm

ig.martix@gmail.com 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


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com