Re: if then statements with radio button

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi Clay,
----- Original Message -----
From: <msuclay at hotmail.com>
To: "EUforum" <EUforum at topica.com>
Subject: if then statements with radio button



> Now that I have learned to group the radio buttons, Could someone give me
> some advice how to do if then statements with them.
>
> If radiobutton1 != 0 and radiobutton2 !=0 then
>   total = 1 X value
> elseif radiobutton2 !=0 and radiobutton3 !=0 then
>   total = 2 X value
>

Try...
  If isChecked(radiobutton1) and isChecked(radiobutton2) then
    total = 1 X value
  elseif isChecked(radiobutton2) and isChecked(radiobutton3) then
    total = 2 X value

To clear them...
  setCheck(radiobutton1, False)
  setCheck(radiobutton2, False)
  setCheck(radiobutton3, False)

However, the way you are using them is not usual for Radio buttons. Usually
only one in a group is "checked" at any time. Maybe you should be using
CheckBox instead? The syntax above works for them to.

------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu