0

i have asp.net form and several radio buttons on it, they contain nested radio buttons (see picture). TextBoxes have Validators.

The question is: how to disable necessary validators when corresponding radio button is unchecked and enable them when radio is checked?

i need to do it on client side by means of javascript.

enter image description here

Do i need to group validators into validation groups?

Any help is appreciated. Thanx in advance))

user1178399
  • 1,028
  • 8
  • 17
  • 32

1 Answers1

1
if(radioButton.Checked)
{
    textBox1.required = false;
}

PS: AutoPostBack needs to be true for the radio button

JSK NS
  • 3,346
  • 2
  • 25
  • 42
Anonimous
  • 11
  • 1