Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
This week, we're updating our course layouts and descriptions. Presentation and materials always gently change over time, but just occasionally there's a need to make a step change to clear out some of the old and roll in the new. That's now happening - but over a long and complex site it's not instant and you'll see sections of the site changing up to and including 19th September.

See also [here] for status update
 
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 " value=1>
                     </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
Hi

Not entirely sure I understand what you mean,

but...

wouldn't this...

Code:
      <input type="hidden" name="cat " value=1>


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.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho