| |||||||||||
| |||||||||||
get input onchange into link Posted by cyrene (cyrene), 14 December 2004 I have some links such as web,images and Sound file and an input text with default value(query). When no changes in input text and user click on any link,it will go to search the qurey according to the link.But the problem is when there is changes in input text and user click on the link.It keep to search the old query according to link. I wish it able to detect and search new query. Here my code: <script LANGUAGE="JavaScript"> function setquery(newquery) { var query = newquery; } </script> print qq(<a href="/cgi-bin/result.cgi?cat=1&query=$query">WEB</a> <a href="/cgi-bin/result.cgi?cat=2&query=$query">IMAGES</a> <a href="/cgi-bin/result.cgi?cat=3&query=$query">SOUND FILE</a> <br> <form name="form_search" method="post" action="/cgi-bin/result.cgi"> <div align="center"> <input type="text" name="query" value="$query" size="30" onchange="setquery(this.value)"> <input type="submit" name="submit" value="Web Search" style="background-color: #FFFAFA;"> <a href="/adsearch.html" class="one"><font size="-1">advanced web search</a> <input type="hidden" name="cat ![]() </div> </form>); } How Perl can get the changes in input text and assign it into link when user click on it? Posted by Custard (Custard), 14 December 2004 HiNot entirely sure I understand what you mean, but... wouldn't this... Code:
point all queries to the same 'cat' ? (and theres some spaces in there that may be a bad thing) And, do you need setquery() at all? I am confused, could you describe your problem some more. Thanks. B Posted by cyrene (cyrene), 16 December 2004 i solve this problem by having some new link for old query and input text only for new query.This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |