A problem with radio buttons group...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

A problem with radio buttons group...

charles61
I have two groups of button sets, part1 and part2. Each group has two buttons: Part1 group: buttons 1a and 1b; and Part2 group: buttons 2a and 2b.

The following script is on a single card with the card script setting groups of buttons to zero when the user gets to the card. I get the desire effect of showing a certain message ("noman") when both buttons 1a and 2a are highlighted or another message ("man") when either button 1b or 2b is highlighted.

But here is my problem. Before the user selects a second button from the second group, I get the message "man" which is not supposed to appear until both choices are made in the two button groups. How can I correct this script so that the message is Not shown UNTIL after both buttons are shown?

switch
      case (hilite of button "part1a" of group "part1" = true and hilite of button "part2a" of group "part2"  = true)
         show field "noman"
         hide field "man"
         break
      case (hilite of button "part1a" of group "part1" = false and hilite of button "part2a" of group "part2"  = true)
         show field "man"
         hide field "noman"
         break
      case (hilite of button "part1a" of group "part1" = false and hilite of button "part2a" of group "part2"  = false)
         show field "man"
         hide field "noman"
         break
      case (hilite of button "part1a" of group "part1"  = true and hilite of button "part2a" of group "part2"  = false)
         show field "man"
         hide field "noman"
         break
   end switch
Reply | Threaded
Open this post in threaded view
|

Re: A problem with radio buttons group...

Mike Bonner
The reason it is behaving this way is you are checking for a false in
your case statements. You only really care about which buttons are
true.  If you check against false you get a match before the 2nd click
because the condition started out as false.

Switch your logic around to only check for true/true only.  So for
example your second case checks part1a of group part1 is false, simply
change the check to group part1b true and you get the correct result
of 1b is checked, but don't get any false positives if nothing is
chosen.
Same for the 3rd case, change both to true checking the opposite
button, so would check for part1b true and part2b true. 4th case,
check for part2b true as your change there.

On Tue, Jul 13, 2010 at 3:34 PM, charles61 <[hidden email]> wrote:

>
> I have two groups of button sets, part1 and part2. Each group has two
> buttons: Part1 group: buttons 1a and 1b; and Part2 group: buttons 2a and 2b.
>
> The following script is on a single card with the card script setting groups
> of buttons to zero when the user gets to the card. I get the desire effect
> of showing a certain message ("noman") when both buttons 1a and 2a are
> highlighted or another message ("man") when either button 1b or 2b is
> highlighted.
>
> But here is my problem. Before the user selects a second button from the
> second group, I get the message "man" which is not supposed to appear until
> both choices are made in the two button groups. How can I correct this
> script so that the message is Not shown UNTIL after both buttons are shown?
>
> switch
>      case (hilite of button "part1a" of group "part1" = true and hilite of
> button "part2a" of group "part2"  = true)
>         show field "noman"
>         hide field "man"
>         break
>      case (hilite of button "part1a" of group "part1" = false and hilite of
> button "part2a" of group "part2"  = true)
>         show field "man"
>         hide field "noman"
>         break
>      case (hilite of button "part1a" of group "part1" = false and hilite of
> button "part2a" of group "part2"  = false)
>         show field "man"
>         hide field "noman"
>         break
>      case (hilite of button "part1a" of group "part1"  = true and hilite of
> button "part2a" of group "part2"  = false)
>         show field "man"
>         hide field "noman"
>         break
>   end switch
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/A-problem-with-radio-buttons-group-tp2288022p2288022.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: A problem with radio buttons group...

charles61
Hi Mike!

Thanks for your help! I just finished looking at your suggestions and your explanations for it. I see what you are talking about. I changed my script and it works just the way I want it to. Thanks again!

Charles Szasz
[hidden email]




On Jul 13, 2010, at 6:25 PM, Mike Bonner [via Runtime Revolution] wrote:

The reason it is behaving this way is you are checking for a false in
your case statements. You only really care about which buttons are
true.  If you check against false you get a match before the 2nd click
because the condition started out as false.

Switch your logic around to only check for true/true only.  So for
example your second case checks part1a of group part1 is false, simply
change the check to group part1b true and you get the correct result
of 1b is checked, but don't get any false positives if nothing is
chosen.
Same for the 3rd case, change both to true checking the opposite
button, so would check for part1b true and part2b true. 4th case,
check for part2b true as your change there.

On Tue, Jul 13, 2010 at 3:34 PM, charles61 <<a href="x-msg://23/user/SendEmail.jtp?type=node&amp;node=2288055&amp;i=0" target="_top" rel="nofollow">[hidden email]> wrote:

>
> I have two groups of button sets, part1 and part2. Each group has two
> buttons: Part1 group: buttons 1a and 1b; and Part2 group: buttons 2a and 2b.
>
> The following script is on a single card with the card script setting groups
> of buttons to zero when the user gets to the card. I get the desire effect
> of showing a certain message ("noman") when both buttons 1a and 2a are
> highlighted or another message ("man") when either button 1b or 2b is
> highlighted.
>
> But here is my problem. Before the user selects a second button from the
> second group, I get the message "man" which is not supposed to appear until
> both choices are made in the two button groups. How can I correct this
> script so that the message is Not shown UNTIL after both buttons are shown?
>
> switch
>      case (hilite of button "part1a" of group "part1" = true and hilite of
> button "part2a" of group "part2"  = true)
>         show field "noman"
>         hide field "man"
>         break
>      case (hilite of button "part1a" of group "part1" = false and hilite of
> button "part2a" of group "part2"  = true)
>         show field "man"
>         hide field "noman"
>         break
>      case (hilite of button "part1a" of group "part1" = false and hilite of
> button "part2a" of group "part2"  = false)
>         show field "man"
>         hide field "noman"
>         break
>      case (hilite of button "part1a" of group "part1"  = true and hilite of
> button "part2a" of group "part2"  = false)
>         show field "man"
>         hide field "noman"
>         break
>   end switch
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/A-problem-with-radio-buttons-group-tp2288022p2288022.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> _______________________________________________
> use-revolution mailing list
> <a href="x-msg://23/user/SendEmail.jtp?type=node&amp;node=2288055&amp;i=1" target="_top" rel="nofollow">[hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
_______________________________________________
use-revolution mailing list
<a href="x-msg://23/user/SendEmail.jtp?type=node&amp;node=2288055&amp;i=2" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/A-problem-with-radio-buttons-group-tp2288022p2288055.html
To unsubscribe from A problem with radio buttons group..., click here.