Link to home
Start Free TrialLog in
Avatar of tneelu3
tneelu3

asked on

Disable radio buttons

How to make one of the radio button disable and other should be enable.
ASKER CERTIFIED SOLUTION
Avatar of gafoor78
gafoor78
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gajender_99
gajender_99

i think you want to check which one is checked because if you click on the frst one then the other one would be desabled if you use the nable command and then you wont be able to click on the disable radio button

if its the matter of checked then you can write this script

clicked event for rb_1
if this.checked=true then
rb_2.checked=False
End if

clicked event for rb_2
if this.checked=true then
rb_1.checked=False
End if

Hi,
a)   A simple way is that u can take the 2 radio buttons in a group box and in the properties of one of the radio button select the checked option. So at any point of the time only one radio button will be enabled while the othere will be disabled. But u can enable the other radio button and when u do so the first one will get disabled.

b)  If u do not want to put the radio buttons in a a group box:
Set one of the radio buttons as checked in the properties.
Assune there are rb_1 & rb_2
clicked event of rb_1
rb_2.checked = false
rb_1.checked = true

clicked event of rb_2
rb_2.checked = true
rb_1.checked = false