Lotek Deviant

simplest way to do this

settings box does this:
2 radio buttons so that you either select optionA or optionB
on click OK settings are saved

Gadget does this:
upon closing of settings dialog box gadget updates to the settings
you entered via funtions such as

function optionCheck()
{ IF OptionA == "true"
do this { some more stuff }

Else
{ do this instead }
}

basically what I would like to do is have the settings dialog box open
with 2 radio button options which are then saved so that I can then
have the gadget can a function that checks the settings and changes
itself accordingly.

This should be really simple but for some reason I just can't get it,



Re: Sidebar Gadget Development radio form buttons?

Jonathan Abbott

Read my article about passing settings on AeroXP

For checkboxes, you need:

HTML:

<input unselectable="on" type="checkbox" id="myID" title="yourTitle">my text

and to reference that in code:

System.Gadget.Settings.write("mySetting", myID.checked);
myID.checked = System.Gadget.Settings.read("mySetting");





Re: Sidebar Gadget Development radio form buttons?

Lotek Deviant

read and tried it but could not seem to get it to work and I need
a radio "checkbox" ... you know the one where you have several
options but can only select one, rather than an actual checkbox
where you can check off all the options. Going to give it another
try...





Re: Sidebar Gadget Development radio form buttons?

Jonathan Abbott

You'll need a select set then, not a checkbox. Here you go:

HTML:
<select id="myID">
<option value="value1">Option1</option>
<option value="value2">Option2</option>
</select>

Code to address that:
myID.value = System.Gadget.Settings.readString("mySetting");
System.Gadget.Settings.write("mySetting", myID.value)




Re: Sidebar Gadget Development radio form buttons?

Lotek Deviant

done, see here for the result: http://www.aeroxp.org/board/index.php showtopic=6391



Re: Sidebar Gadget Development radio form buttons?

Lotek Deviant

actually as you can see if you download the clock that radio buttons worked
great :) ... now to see if I can come up with some nice faces for it too.