daivdo's response above is good advice, what you appear to want to do is to make change dynamic, this could be done with an AJAX XHtmlRequest, and a rewrite of the results div done in Javascript called by an onchange event handler associated with the drop down menu.
However to get a feel for the idea, a simple
<!--
<script language="javascript">
function sortResults(){
var myForm=getElementByID("myForm");
myForm.submit();
}
</script>
-->
<form action="returnResults.pl" id="myForm" method="POST">
<select name="sortBy">
<option value="byDate">Date...</select>
<input type="text" name="searchCriteria" value="$WHATEVER WE GOT INITI
+ALLY">
</form>
This will recall the script with a sortBy parameter set, of course it will reload the whole page.
After you get this method to work, have a look at AJAX for inline changes on a page, again as davido said, knowledge has to be acquired and it's not an instantaneous process, however it's a rewarding one.
Happy learning ;)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.