I have two select forms both using onChange but I am getting an error message when they are both used on the same page. When they are used seperately they work fine without error message. One form just redirects the user to a new page based on what user selects, the second select form displays a text field if a certain option is selected.
The error message says:"document.forms[0].elements.shippingCode.style"
Can anyone see why I might be getting an error?
Code:<!--drop down form with hidden text field--> <script type="text/JavaScript"> function showhide(f,v){ var t = f.elements['shippingCode']; if(v=='International' ¦¦ v=='Custom'){t.style.visibility='visible'} else{t.style.visibility='hidden'} } onload = function(){document.forms[0].elements['shippingCode'].style.visibility='hidden'} </script> <form name="order" id="order" method="post" action="orderForm.cfm"> <select name="countryShip" onchange="showhide(this.form,this.value)"> <option value="United States"> Stardard (ship to US)</option> <option value="Canada">Standard (ship to Canada)</option> <option value="International"> International</option> <option value="Custom"> Custom Shipping</option> </select> <input name="shippingCode" type="text" value=""> </form> <!--dropdow for url redirect--> <script type="text/javascript"> function goThere(loc) { window.location.href=loc; } </script> <FORM> <select onChange="goThere(this.options[this.selectedIndex].value)" name="s1"> <option value="page1.html">place1</option> <option value="page2.html">place2</option> <option value="page3.html">place3</option> </select> </FORM>



Reply With Quote

Bookmarks