G
Guest
I have written JavaScript and try to change the radio button property
(disenable other radio buttons) once click on it. But it does not work. For
example, I have radio buttons A, B, and C. A and B are in the same group AB.
When A is selected, C is enabled; otherwise, C is disabled. MY code is:
JavaScript:
function enableC(){
document.Form1.C.enabled = true;
}
function disenableC(){
document.Form1.C.enabled = false;
}
In asp.net codebehind:
rbtnA.Attributes.Add("onClick", "enableC()")
rbtnB.Attributes.Add("onClick", "disableC()")
What is wrong with it?
Can we use JavaScript in this way?
Of course, I can use it to perform calculation and set value to textbox in
this way.
Thank you for your any help.
David
(disenable other radio buttons) once click on it. But it does not work. For
example, I have radio buttons A, B, and C. A and B are in the same group AB.
When A is selected, C is enabled; otherwise, C is disabled. MY code is:
JavaScript:
function enableC(){
document.Form1.C.enabled = true;
}
function disenableC(){
document.Form1.C.enabled = false;
}
In asp.net codebehind:
rbtnA.Attributes.Add("onClick", "enableC()")
rbtnB.Attributes.Add("onClick", "disableC()")
What is wrong with it?
Can we use JavaScript in this way?
Of course, I can use it to perform calculation and set value to textbox in
this way.
Thank you for your any help.
David