small problem greenz for answer

Discussion in 'JavaScript' started by klown, Nov 22, 2006.

  1. #1
    I have a small problem with a form, it works in FF but not in IE.

    I have a select menu

     
    <select name="system" id="system">
       <option value="/resources/bmicalculator.php" <?php if ($system=="us") {} else {echo "selected";}?> onClick="jump('/resources/bmicalculator.php');">Metric System</option>
       <option value="/resources/bmicalculator.php?system=us" <?php if ($system=="us") {echo "selected";}?> onClick="jump('/resources/bmicalculator.php?system=us');">US System</option>                                                                                               </select>
    Code (markup):
    when somebody clicks on one of the selections it jumps them to a different page with the following js

    
    function jump(address)
    {
    document.location.href=address;
    }
    
    Code (markup):
    any idea whats wrong?
     
    klown, Nov 22, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Do

    
    <select name="system" id="system" onchange="jump(this.value);">
    
    HTML:
    EDIT:

    And it should be window.location
     
    nico_swd, Nov 23, 2006 IP
    klown likes this.
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    I use the following:
    
    <select name="system" id="system" onchange="jump(this.value);"  onFocus="jump(this.value);">
    
    Code (markup):
     
    ajsa52, Nov 23, 2006 IP
    klown likes this.