I personally have no javascript experience what so ever. I'm just looking for someone who can write the code for me for free. Example: <form id="form1" name="form1" method="post" action=""> <option value="US" selected="selected">United States</option> <option value="AU">Australia</option> <option value="CA">Canada</option> <option value="GB">United Kingdom</option> <option value="B"></option> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <select name="states" class="select"> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="AA">Armed Forces Americas</option> <option value="AE">Armed Forces Europe</option> <option value="AP">Armed Forces Pacific</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> </form> HTML: I want the "states" drop down disabled unless the value "US" is selected on the "country" drop down.
this should work, though it wasn't tested: <script type="text/javascript"> function enableStates(to_enable) { var statesSelectObj = document.getElementById('states_select'); if (statesSelectObj) { if (to_enable) { statesSelectObj.removeAttribute('disabled'); } else { statesSelectObj.setAttribute('disabled', 'disabled'); } } } </script> <form id="form1" name="form1" method="post" action=""> <!-- you forgot to put this select tag... --> <select name="country_select" onchange="enableStates(this.options[this.selectedIndex].value == 'US');">[/B] <option value="US" selected="selected">United States</option> <option value="AU">Australia</option> <option value="CA">Canada</option> <option value="GB">United Kingdom</option> <option value="B"></option> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <!-- and end select tag --> </select> <select name="states" class="select" id="states_select"> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="AA">Armed Forces Americas</option> <option value="AE">Armed Forces Europe</option> <option value="AP">Armed Forces Pacific</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> </form> HTML: