Link to home
Create AccountLog in
Avatar of urjudo
urjudoFlag for United States of America

asked on

coding for Radio(option) button & check boxes

Hi Experts,
I have a question about the option button and check boxes.  I have a form that has two option buttons and four check boxes
optA  & optB  -- > option buttons
ckb1, ckb2, ckb3 & ckb4  --  > check boxes

here is the details:
users can select either optA or optB
users only can select ckb1 or/and ckb2 and ckb3& ckb4 will be disable or ckb3 or/and ckb4 and ckb1 & ckb2 will be enable
I got this part works.

so when a user select optA and check ckb1 & ckb2 then ckb3 & ckb will be disable, what I want to to is if that user change her mind and select optB, I want ckb1 & ckb2 uncheck and ckb3 & ckb4 enable?  


I set all the check boxes lock = true (users have to select the option button before they can check the check boxes)
I have my code in both optA & optB on click:
  If optA = true then
     ckb1.locked = false
     ckb2.locked = false
     ckb3.locked = false
     ckb4.locked = false
 else
     ckb1.locked = true
     ckb2.locked = true
     ckb3.locked = true
    ckb4.locked = true
     ckb1..defaultValue = false
     ckb2.defaultValue = false
     ckb3.defaultValue = false
     ckb4.defaultValue = false
 end if

  If optB = true then
     ckb1.locked = false
     ckb2.locked = false
     ckb3.locked = false
     ckb4.locked = false
 else
     ckb1.locked = true
     ckb2.locked = true
     ckb3.locked = true
    ckb4.locked = true
     ckb1..defaultValue = false
     ckb2.defaultValue = false
     ckb3.defaultValue = false
     ckb4.defaultValue = false
 end if

this seems not work as I want to, I have to uncheck the ckb1 and ckb2 then ckb3 & ckb4 will enable.  am I missing something?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of urjudo

ASKER

@john,
thanks for the quick sample, I test your sample, when I check one of the check box then I select the option box, the check box still check is not uncheck
Avatar of urjudo

ASKER

Thanks John