enable / disable combobox using checkbox
-
Hi, I have a php file with cboMonth and cboYear drop downs and I have chkPresent in the same page. I want to know how can I disable the cboMonth and cboYear and set both value to null if the chkPresent is checked? Thanks, Jassim[^] Technology News @ www.JassimRahma.com
-
Hi, I have a php file with cboMonth and cboYear drop downs and I have chkPresent in the same page. I want to know how can I disable the cboMonth and cboYear and set both value to null if the chkPresent is checked? Thanks, Jassim[^] Technology News @ www.JassimRahma.com
Add this in HTML of chkPresent onclick=”AssignValueOnCheckboxTick(this.checked)" Now Add this in Java Script <script type="Javascript"> var cboMonth = document.getElementById('<%= cboMonth.ClientID %>'); var cboYear = document.getElementById('<%= cboYear.ClientID %>'); function AssignValueOnCheckboxTick(ischecked) { if (ischecked) { var cboMonth.style.display = 'block'; cboYear.style.display = 'block'; } else { cboMonth.style.display = 'none'; cboYear.style.display = 'none'; } } </script>