Trying to figure out a select box issue

Trying to figure out a select box issue

I am trying to create a form in which the child 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.  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>
</select>


 
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 = "";
document.getElementById('teacher').value="";
document.getElementById('room').value="";}
}