
Originally Posted by
aharvey
resets the combo box to the first selection on the list, even in the absence of instructions to do so
Well, reloading the page is 'instructions to do so'. When you click on one of those links you are reloading the page with new information in the address as to what to display on the right. So anyways, to avoid this we must give additional instructions on page load. I see you are already passing information to the page about what to display on the right. If you test the url you could determine which drop contents to display based upon that:
Code:
<script type="text/javascript">
var chkURL=unescape(location.href)
if (chkURL.indexOf('Actinopygaagassizii')!==-1)
document.dropmsgform.dropmsgoption.selectedIndex=5
</script>
This script should go directly after the the form. Remember that options are numbered starting at 0 so 5 corresponds to:
HTML Code:
<option>Echinodermata (sea stars, sea cucumbers, sea urchins, etc.)</option>
You will of course need to expand considerably upon the above script adding in tests for each ?spp= keyword that you have and associating it with the correct option number from the form. Just follow the the pattern of:
Code:
if (chkURL.indexOf('wordToCheckFor')!==-1)
document.dropmsgform.dropmsgoption.selectedIndex=actualNumberOfOption
adding each beneath the one I've supplied:
Code:
<script type="text/javascript">
var chkURL=unescape(location.href)
if (chkURL.indexOf('Actinopygaagassizii')!==-1)
document.dropmsgform.dropmsgoption.selectedIndex=5
if (chkURL.indexOf('wordToCheckFor')!==-1)
document.dropmsgform.dropmsgoption.selectedIndex=actualNumberOfOption
</script>
Order is unimportant but, you will want to go in sequence to make sure you haven't missed any.
Bookmarks