Enable Disabled Select Box
- Home
- Javascript
- Enable Disabled Select Box
Have a combobox <SELECT><OPTION</OPTION></SELECT>,which needs to be made un-editable. If you use the "readonly" attribute, it is editable. And if you use the "Disabled" attribute, you are not able to read the field in the following ASP page after submitting the first one.
To get around the limitations, use "disabled" but fire a javascript function on the onsubmit event of the form and before submitting your page; in script you enable your select box.
Code
document.forms[0].mySel.disabled = false
asp javascript onSubmit functions select box disabled readonly