i have two control 1. Dropdown List and 2. Textbox employee department is display in Dropdown list.
if user select "OTHER" from dropdown list then textbox is enable for the manual entry for Department i have used Required field validator to validate textbox.
but when it is disable also that time its validate by required field validate.
i want to validate that textbox only that time when dropdown list box selected "OTHER" and textbox is enable.
if (dropdepartment.Text == "OTHER")
{
txtotherdepartment.Enabled = true;
if (dropdepartment.Text == "OTHER" && txtotherdepartment.Text == "")
{
requiredfiled1.Enabled = true;
}
else
{
requiredfiled1.Enabled = false;
}
}
else
{
txtotherdepartment.Enabled = false;
}