Image

I've been working on my site, WTeeF.com and fixed my osCommerce issue thanks to hetler.



But now I have one more thing I need help with.



On my site I need 2 drop down menus that work together so people can
choose a shirt color and a size. However, I think my code is a
litttttle off...



Here is what it is:



<form name="doublecombo">

<p><select name="example" size="1"
onchange="redirect(this.options.selectedIndex)"><option>Solid
Color T – Dark Blue</option><option> Solid Color T - Red
</option><option> Solid Color T - White
</option></select>

<select name="stage2" size="1"><option value="
">Small</option><option value=" "> Medium
</option><option value=" "> Large </option><option
value=" "> Extra Large </option></select>



<input name="test" value="Order" onclick="go()" type="button">

</p>



<script>

<!--



/*

Double Combo Script Credit

By JavaScript Kit (www.javascriptkit.com)

Over 200+ free JavaScripts here!

*/



var groups=document.doublecombo.example.options.length

var group=new Array(groups)

for (i=0; i<groups; i++)

group[i]=new Array()



group[0][0]=new Option("Small","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=75")

group[0][1]=new Option("Medium","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=74")

group[0][2]=new Option("Large","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=159")

group[0][3]=new Option("Extra Large","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=76")





group[1][0]=new Option("Small ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=163")

group[1][1]=new Option("Medium ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=162")

group[1][2]=new Option("Large ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=160")

group[1][3]=new Option("Extra Large ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=157")





group[2][0]=new Option("Small ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=164")

group[2][1]=new Option("Medium ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=161")

group[2][2]=new Option("Large ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=29")

group[2][3]=new Option("Extra Large ","http://wteef.com/osCommerce/catalog/product_info.php?cPath=21&products_id=158")





var temp=document.doublecombo.stage2



function redirect(x){

for (m=temp.options.length-1;m>0;m--)

temp.options[m]=null

for (i=0;i<group[x].length;i++){

temp.options[i]=new Option(group[x][i].text,group[x][i].value)

}

temp.options[0].selected=true

}



function go(){

location=temp.options[temp.selectedIndex].value

}

//-->

</script>



</form>



The problem is that you must choose a shirt color and size, regardless if it's already set to it on default...



It's hard to explain, but I'm sure someone can help me out.



Thanks for any help!