...

View Full Version : problem with jumping urls in select box



tittle65
07-14-2003, 06:41 PM
Hi, all. This seems like a very simple javascript but I'm having a bit of trouble with it. It's just a select box that's set to jump to urls immediately based on what you select. It's supposed to degrade if no javascript via a submit button that's also supplied. But once the submit button's used, the javascript appears to be disabled for these select boxes (the effect of the url jumps/submissions are to reset variables pertaining to the entire page, so the select boxes are displayed once more after "jumping" -- the "same" page is generated again, displaying the new values).

Is this a "feature"? I've examined the code before and after, and am generating the same setup for the select boxes each time, so I don't think it's something I've done (but hey, we all think that while debugging :-). I checked to see if I could find the same behavior in other jump-style select boxes, but since the examples I found take you to separate pages on jumping, they don't create the same conditions as this one does.

This is javascript embedded in a cgi-generated html file that is running on a Solaris (apache) platform. I've observed the same behavior in IE 6 and in Netscape 7.0.

I took care to make sure the same four variables (uid, form, GreekFont, and GreekInputFont) are represented for each method of going back to the textsearch cgi script (url vs form submission).

There are two more (unnamed) forms on this same page after this one, but they do not contain any other javascript elements.

Here is the fragment of code (which I've double checked that appears the same on the initial page and subsequent ones). The site itself is subscription only, or else I'd list the pages themselves for you to see. Hopefully this is enough info.

<form name="inputdisplayform" method = "post" action = "/inst/textsearch" >
<input type = "hidden" name = "uid" value = "">
<input type = "hidden" name = "form" value = "simple">

<div align="center">
Greek display?
<select name = "GreekFont" size = "1" onChange="godisplay();">
<option value = "Beta" selected>Beta Code
<option value = "Translit" >Translit (no acc)
<option value = "AccTranslit" >Translit (w/ acc)
<option value = "Unicode" >Unicode
<option value = "GreekKeys" >GreekKeys
<option value = "WinGreek" >WinGreek
<option value = "SGreek" >SGreek
<option value = "Ismini" >Ismini
<option value = "SPIonic" >SPIonic
<option value = "LaserGreek" >LaserGreek
<option value = "SuperGreek" >SuperGreek
</select>
<script language="javascript">
<!--
function godisplay() {
location="/inst/textsearch?uid=&form=simple&GreekInputFont=Beta&GreekFont=" +
document.inputdisplayform.GreekFont.options[document.inputdisplayform.GreekFont.selectedIndex].value}
//-->
</script>

Greek input?
<select name = "GreekInputFont" size = "1" onChange="goinput();">
<option value = "Beta" selected>Beta Code
<option value = "Translit" >Transliteration
<option value = "Latin7" >Latin-7 (Mod. Greek)
</select>
<script language="javascript">
<!--
function goinput() {
location="/inst/textsearch?uid=&form=simple&GreekFont=Beta&GreekInputFont=" +
document.inputdisplayform.GreekInputFont.options[document.inputdisplayform.GreekInputFont.selectedIndex].value}
//-->
</script>

<input type = "submit" name = "resetinputdisplay" value = "Reset Fonts">

</form>



Thanks!

mordred
07-15-2003, 10:20 AM
I could not reproduce the error you describe, it works as expected in Mozilla. Are you sure the content of the site is exactly the same? What does the JavaScript console say about eventual errors?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum