I have an online form which has a select element, which I;m using very basic JS to enable and disable a select element based on the selection of another select element.
For some reason, the JS disables the select element correctly, but it does not re-enable it. Could someone please help with the right code.
here is the Javascript code.
Expand|Select|Wrap|Line Numbers
- function annconf() {
- var vfullearly = document.getElementById('fullearly').value;
- if (vfullearly = 1)
- {
- document.getElementById('fullnorm').disabled=true;
- }
- else if (vfullearly = 0)
- {
- document.getElementById('fullnorm').disabled=false;
- }
- }
Expand|Select|Wrap|Line Numbers
- <form>
- Price early:
- <label>
- <select name="Full, Early Bird" id="fullearly" onchange="annconf();">
- <option value="0">No</option>
- <option value="1">Yes</option>
- </select>
- </label>
- </p>
- <p> Price Normal:
- <select name="Full, Normal" id="fullnorm">
- <option value="0">No</option>
- <option value="1">Yes</option>
- </select>
- <form>