Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts

    I moved this script to a new design, and now it is not working

    Here is the script from my original design:

    In the head tag:
    Code:
    <script language="JavaScript" type="text/javascript">
    <!--
    
    var Opt1=[];
    Opt1[0]=['Front Sideline','Front Sideline'];
    Opt1[1]=['Front Hash','Front Hash'];
    Opt1[2]=['Back Hash','Back Hash'];
    
    var Opt2=[];
    Opt2[0]=['Back Sideline','Back Sideline'];
    Opt2[1]=['Front Hash','Front Hash'];
    Opt2[2]=['Back Hash','Back Hash'];
    
    var Opt3=[];
    Opt3[0]=['Front Sideline','Front Sideline'];
    Opt3[1]=['Back Sideline','Back Sideline'];
    Opt3[2]=['Front Hash','Front Hash'];
    Opt3[3]=['Back Hash','Back Hash'];
    
    function Pop(id,ary){
     var obj=document.getElementById(id);
     obj.options.length=0;
     for (var zxc0=0;zxc0<ary.length;zxc0++){
      obj.options[zxc0]=new Option(ary[zxc0][0],ary[zxc0][1],true,true);
     }
     obj.selectedIndex=0;
    }
    //-->
    </script>
    </head>
    Then the part in the body that uses this:
    Code:
     <input type="radio" name="AB" value="Above" onClick="Pop('Line',Opt1);">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="AB" value="Below" onClick="Pop('Line',Opt2);">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="AB" value="On" onClick="Pop('Line',Opt3);">
    &nbsp;&nbsp;&nbsp;&nbsp;
    <b>the</b>
    
        <select name="Line" id="Line">
    	<option>Above, Below or On?</option>
    	</select>

    Now in the new design:
    In the head tag:
    Code:
    <script language="JavaScript" type="text/javascript">
    <!--
    
    var Opt1=[];
    Opt1[0]=['Front Sideline','Front Sideline'];
    Opt1[1]=['Front Hash','Front Hash'];
    Opt1[2]=['Back Hash','Back Hash'];
    
    var Opt2=[];
    Opt2[0]=['Back Sideline','Back Sideline'];
    Opt2[1]=['Front Hash','Front Hash'];
    Opt2[2]=['Back Hash','Back Hash'];
    
    var Opt3=[];
    Opt3[0]=['Front Sideline','Front Sideline'];
    Opt3[1]=['Back Sideline','Back Sideline'];
    Opt3[2]=['Front Hash','Front Hash'];
    Opt3[3]=['Back Hash','Back Hash'];
    
    function Pop(id,ary){
     var obj=document.getElementById(id);
     obj.options.length=0;
     for (var zxc0=0;zxc0<ary.length;zxc0++){
      obj.options[zxc0]=new Option(ary[zxc0][0],ary[zxc0][1],true,true);
     }
     obj.selectedIndex=0;
    }
    //-->
    </script>
    </head>
    Part in body that uses:
    Code:
    <input type="radio" name="AB" value="Above" onClick="Pop('Line',Opt1);">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="AB" value="Below" onClick="Pop('Line',Opt2);">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="AB" value="On" onClick="Pop('Line',Opt3);">
    &nbsp;&nbsp;&nbsp;&nbsp;
    <b>the</b>
    
        <select name="Line" id="Line">
    	<option>Above, Below or On?</option>
    	</select>
    In the new design, When I choose a radio button, instead of the new options being put in, it just makes the select box blank.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I just tested both scripts locally and they both work fine for me so I'm not sure what the problem is.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •