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 Adrienne Boswell on 03/30/07 03:28

Gazing into my crystal ball I observed "Martix" <ig.martix@gmail.com>
writing in news:1174936716.054843.57900@y66g2000hsf.googlegroups.com:

> Hello
>
> I would like to pass the value of a inputbox through a hyperlink. I
> know this can be done with a single valuelike:
>
><a href="employee.asp?e_num=6">Market Info </a>
>
> My problem is that I need the "6" to be a variable pending on what's
> in the input box.
>
> How do I do that?
>

Quick and dirty:
<% option explicit
dim employee, goodtogo, rs, rsarr, sql
dim ix, field, inputvalue, thestring

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
For ix = 1 to Request.Form.Count
field = request.form.key(ix)
inputvalue = request.form.item(ix)
TheString = field & "= Request.Form(""" & field & """)"
Execute(TheString)
next

sql "SELECT id, name FROM table WHERE field = " & employee
rs.open sql, connectionstring
if rs.open then
rsarr = rs.getrows()
recordsfound = true
else
recordsfound = false
end if
rs.Close
set rs = nothing
goodtogo = true
else
goodtogo = false
end if
%>
<% if not goodtogo then %>

<form method="post" action="<%=request.servervariables("HTTP_REFERER")%>">
<div>
<label for="employee" id="employee1">Employee: </label>
<input type="text" name="employee" id="employee" value="<%=employee%>">
<input type="submit" value="Submit">
</div>
</form>

<% else%>

<ul>
<% for i = 0 to ubound(rsarr)%>
<li><a href="page.asp?id=<%=rsarr(0,i)%><%=rsarr(1,i)%></li>
<% next%>
</ul>

<% end if%>
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 

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

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