Disabling textbox based on combo
-
Iam using Asp.net and c# for backend coding. i have to disable a textbox when a comboboxes value is not set at all, i mean ("--select--). when we happen to change that combbox value to some other values other than --select-i want the textbox to be enabled.
-
Iam using Asp.net and c# for backend coding. i have to disable a textbox when a comboboxes value is not set at all, i mean ("--select--). when we happen to change that combbox value to some other values other than --select-i want the textbox to be enabled.
You can either write an procedure on onchange event of combobox or make autopostback attribute to true for combobox. And in the code behind file check the combobox value if its other then --select-- set textbox enabled if (Convert.ToInt32(cmbModLev.SelectedItem.Value) != 0) txtBox.Enabled =true; else txtBox.Enabled =false; Share knowledge to enhance your learning