detect if Radio Button selected in group

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sab2
Posts: 6
Joined: Sat Nov 22, 2014 2:44 pm

detect if Radio Button selected in group

Post by sab2 » Sun Nov 23, 2014 3:03 pm

Hello,
I have 4 radio buttons in a group called "resemble" and a submit button. If you click the submit button i want to make sure a radio button is selected before going to next page. Here is my script. When submit button clicked - I want to check that a radio button is selected before going to next page. How do I script the submit button to make sure a radio button is selected then go to next card - if no radio button selected then beep. Thanks. Sue
Script on submit button...
on mouseUp
if the hilitedButton of group "resemble" = zero then
beep
else
go to card"page5"
end if
end mouseUp

on opencard i have the card script ... set the hilitedbutton of group "resemble" to zero. So when user opens card they need to select a radio button then click submit to next page.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: detect if Radio Button selected in group

Post by Klaus » Sun Nov 23, 2014 3:27 pm

Hi Sue,

1. welcome to the forum! :D

2. You can check:
the hilitedbutton of grp XYZ -> this will return the number of the button selected, e.g 1 = first button in group etc.
the hilitedbuttonname of grp XYZ -> will return the NAME of the button currently selected in that group of radiobuttons.

With "hilitedbutton" check for 0, or for EMPTY with "hilitedbuttonname":
...
if the hilitedButton of group "resemble" = 0 then
...
if the hilitedButtonname of group "resemble" = EMPTY then
...


Best

Klaus

sab2
Posts: 6
Joined: Sat Nov 22, 2014 2:44 pm

Re: detect if Radio Button selected in group

Post by sab2 » Sun Nov 23, 2014 3:58 pm

Thank you very much for your reply.

Post Reply