You are here: Re: Pass the value of a input box through a hyperlink « HTML « IT news, forums, messages
Re: Pass the value of a input box through a hyperlink

Posted by Jonathan N. Little on 03/29/07 23:31

Martix wrote:
<snip>
> So even if I had a row of buttons instead of link. How would I code it
> so that each button links it to a different page? I don't want to use
> a list box
>
You don't as I demonstrated earlier in the thread. You post to an
intermediate handler script that depending on which submit button is
click will serve up related info...

You could do it either by putting a select box for the resource you wish
to retrieve:

"getstuff.asp" method="post">
<div>
<label for="e_num">Employee No:
<input name="e_num" id="e_num" type="text">

<label for="r_id">
<select name="r_id" id="r_id">
<option value="1">Contact info</option>
<option value="2">Qualifications</option>
....
<option value="n">Employment History</option>
<input type="submit" value="Go Fetch!">
</select>

</div>
</form>

Then have "getstuff.asp"
[pseudocode]

Switch "r_id"

case is 1: query dB for "e_num" contact info
case is 2: query dB for "e_num" qualifications info


OR you can have different named submit buttons:

"getstuff.asp" method="post">
<div>
<label for="e_num">Employee No:
<input name="e_num" id="e_num" type="text">
</div>
<div>
<input type="submit" name="contact" value="Contact Info">
<input type="submit" name="qualifications" value="Qualifications">
<input type="submit" name="history" value="History">
....
</div>
<form>

Then have "getstuff.asp"
[pseudocode]

If POST var "contact" exists {
query dB for "e_num" contact info
}
else if POST var "qualifications" exists {
query dB for "e_num" qualifications info
}
else if POST var "history" exists {
query dB for "e_num" history info
}

and so on...

The query can also be a redirect...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация