I am trying to create a form in which the child section fields are disabled or enabled based on whether you chose one or the other. I was able to do it with a checkbox, but i want it to work with the drop down select value. i am not sure if im getting a value right or using the right command to do the onchange. here is the link and the script below:


Here is the select script:
<select name="type" class="input" id="type" onchange="type()">
<option value="General">General</option>
<option value="Walk-a-thon">Walk-a-thon</option>

and here is the function script:
function type(){

if (document.getElementById('type').value=='Walk-a-thon') {
document.getElementById('child').disabled = false;
document.getElementById('teacher').disabled = false;
document.getElementById('room').disabled = false;
else {
document.getElementById('child').disabled = true;
document.getElementById('teacher').disabled = true;
document.getElementById('room').disabled = true;
document.getElementById('child').value = "";