# Save the Value/State of a radio button in Preferences

**URL:** <https://forums.solar2d.com/t/save-the-value-state-of-a-radio-button-in-preferences/351953>\
**Category:** Newbie Questions\
**Created:** [July 27, 2020, 4:09pm UTC](https://forums.solar2d.com/t/save-the-value-state-of-a-radio-button-in-preferences/351953 "2020-07-27T16:09:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [July 27, 2020, 4:15pm UTC](https://forums.solar2d.com/t/save-the-value-state-of-a-radio-button-in-preferences/351953/3 "2020-07-27T16:15:50Z")

</div>

This is the same principle as the question you asked here:

> [@Save the Value of a Text Field](https://forums.solar2d.com/t/save-the-value-of-a-text-field/351863/3):
>
> This is easy peasy with SSK2. Here is a working example: [https://github.com/roaminggamer/RG\_FreeStuff/raw/master/AskEd/2020/07/nativeTextFields\_restore.zip](https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2020/07/nativeTextFields_restore.zip) Here is the important code: require "ssk2.loadSSK" \_G.ssk.init() -- ============================================================= local group = display.newGroup() local saved\_fields = table.load('saved\_fields.json') or {} local listener = function( self, event ) saved\_fields[self.myNum] = self.text table.save( saved\_fields, 'saved\_fi…

- Save the button values every time the user touches them.
- On clean-restart, load the last saved values and toggle the buttons if needed after you create them.

---

_[View the full topic](https://forums.solar2d.com/t/save-the-value-state-of-a-radio-button-in-preferences/351953)._
