posted 15 years ago
Hello, I am having a compatibility problem with a drop down list and Firefox. The obvious fix is a little JavaScript that I can't seem to get to work.
I have a drop down list that the user will select from. On the click of a button (image), I need to go to the new url.
This is my original code that doesn't work with Firefox; anybody know how to make it compatible?
<form name="frmSelectLicense">
<DIV>
<select name="mylicensebox">
<option value="/code-128-barcode-font.aspx">Select License Type</option>
<option value="/code-128-barcode-fonts-1U.aspx" selected="selected">One User License ($95)</option>
<option value="/code-128-barcode-fonts-10U.aspx">Ten User License ($190)</option>
<option value="/code-128-barcode-fonts-100U.aspx">One Hundred User License ($380)</option>
</select>
</DIV>
<DIV>
<a href="#" OnClick=location.href=mylicensebox.value>
<IMG src="/graphics/buy-now.gif" alt="Buy PrecisionID Code 128 Barcode Fonts" border="0" title="Buy Code 128 Barcode Fonts">
</a>
</DIV>
</form>
I found and adapted this JavaScript but the jump occurs with selection, not the click of the "buy-now" image. Any help is appreciated.
<script type="text/javascript">
function jump(objSelect){
if (objSelect.selectedIndex<=0) return false;
var objOpt = objSelect.options[objSelect.selectedIndex];
window.location.href=objOpt.value;
}
</script>
<select onChange="jump(this);">
<option value="/code-128-barcode-font.aspx">Select License Type</option>
<option value="/code-128-barcode-fonts-1U.aspx">One User License ($95)</option>
<option value="/code-128-barcode-fonts-10U.aspx">Ten User License ($190)</option>
<option value="/code-128-barcode-fonts-100U.aspx">One Hundred User License ($380)</option>
</select>
</div>
<div>
<a href="#" OnClick=location.href=mylicensebox.value>
<IMG src="/graphics/buy-now.gif" alt="Buy PrecisionID Code 128 Barcode Fonts" border="0" title="Buy Code 128 Barcode Fonts">
</a>
</div>