toggling radiobutton state

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Jeroen Offline
Skilled Skinner
Posts: 1,882
Joined: Feb 2008
Reputation: 4
Location: The Netherlands
Post: #1
Is there a way to toggle a radiobutton's state based on the state of a second radiobutton?

I have two radiobuttons, one to allow the user a single image as the homescreen background, another to set up a multiimage control

Functionally these reset each other's values and they are working as intended. I would like to however, provide a visual indication of which one is activated

So in short: radiobutton A is checked, radiobutton B is unchecked.
find quote
toiva Offline
Posting Freak
Posts: 817
Joined: Aug 2008
Reputation: 14
Post: #2
You send 2 onclicks, the normal one and the second one with an onclick condition that checks if the other one is toggled and sends the onclick if it is?
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,927
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #3
Use
Code:
SubString(Control.GetLabel(BUTTON_ID),*)
for radiobutton on.

[Image: sig_zps3af3b48e.jpg]
find quote
`Black Offline
Skilled Skinner
Posts: 2,003
Joined: Apr 2009
Reputation: 49
Location: Germany
Post: #4
It's fairly simple:

Button a:
<onclick>Skin.ToggleSetting(setting_a)</onclick>
<onclick>Skin.Reset(setting_b)</onclick>

Button b:
<onclick>Skin.ToggleSetting(setting_b)</onclick>
<onclick>Skin.Reset(setting_a)</onclick>

The second onclick can also have a condition, e.g. for button a it would be condition="Skin.HasSetting(setting_b)".

[Image: xp1080.png]
(This post was last modified: 2013-04-07 14:59 by `Black.)
find quote
Jeroen Offline
Skilled Skinner
Posts: 1,882
Joined: Feb 2008
Reputation: 4
Location: The Netherlands
Post: #5
Thanks guys, I'm a little rusty Wink
find quote