• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dropdown List and Command button

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to change your code below:


to
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Todd Kanipe, please be sure to use code tags to highlight your code (rather than blue text).
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTML tags and attribute names are to be written in all lowercase.
HTML attribute values are to be surrounded with double quotes.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to use

when referencing an element.
Eric
 
Todd Kanipe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for the help. I've finally gotten it to work. It turnout there there was another form declared in the code that was messing with my addition. Once I figured that out, I was able to adjust. Again, Thanks!!!
 
Do you want ants? Because that's how you get ants. And a tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic