# Saving radio button values to display later on

**URL:** <https://forum.wixstudio.com/t/saving-radio-button-values-to-display-later-on/73660>\
**Category:** Ask the community\
**Tags:** wix-storage-frontend, code, question, wix-studio\
**Created:** [September 18, 2025, 5:46pm UTC](https://forum.wixstudio.com/t/saving-radio-button-values-to-display-later-on/73660 "2025-09-18T17:46:48Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [September 27, 2025, 6:14pm UTC](https://forum.wixstudio.com/t/saving-radio-button-values-to-display-later-on/73660/7 "2025-09-27T18:14:40Z")

</div>

Ok, back again to your problem.

Looking onto your description and the very good and informative video of **AMANDA (Wix-Team)**, i think your problem is not about the Wix-Storage. I think it is more about how to setup your wanted functionality the right way.

The Video clearly explains everything about how Wix-Storage is working.

**Your aim is what?**  
You want to transfer a value from PAGE-A to PAGE-B, right?

> _I want a value from a radio button to be passed to a “conclusion” page_

_So s_omewhere on **PAGE-A** you have your **RADIO-BUTTON** → user do interact with it (clicking onto it) → and exactly at that time you want to store the clicked value to your → **SESSION-STORAGE** ←

And i think a **t the same time** you want also to **navigate automatically** to **PAGE-B** → **“conclusion” page**???

.

## **Let’s make an example!**

Let this be your **RADIO-BUTTON-GROUP** …

 ![2025-09-27 19_38_57-Wix Website-Editor _ Xxxxx](https://us1.discourse-cdn.com/wix/original/3X/1/e/1e33f738a31ec6c51ee346a8d4269d7afe1f6e5a.png)

**You start like always with the basics …**

```javascript
$w.onReady(function () {console.log('...page is ready...');
    let myRBG = $w('#radioGroup1');
    let rbgOptions = myRBG.options; console.log('RBG-OPTIONS: ', rbgOptions);
    let rbgValue = myRBG.value; console.log('RBG-VALUE: ', rbgValue);
});

```

**So what do we have here?**  
**1)** _STARTING SEQUENCE…_

```javascript
$w.onReady(function () {
    ...START OF CODE... (when PAGE IS READY) !!!!
});

```

**2)** _Some definitions…_

```javascript
let myRBG = $w('#radioGroup1');
let rbgOptions = myRBG.options; console.log('RBG-OPTIONS: ', rbgOptions);
let rbgValue = myRBG.value; console.log('RBG-VALUE: ', rbgValue);

```

**a)** _getting your RADIO-BUTTON-GROUP-ELEMENT and define it into a variable, called myRGB…_ → thisfor you also give it a 3-char prefix like → **rgb** ← normaly, but in this case we just call it → **myRGB** \<—

```javascript
let myRBG = $w('#radioGroup1');

```

**b)** _Grabbing the options of → myRGB ←_

```javascript
let rbgOptions = myRBG.options; console.log('RBG-OPTIONS: ', rbgOptions);

```

**c)** _Getting the values of → myRGB ←_

```javascript
let rbgValue = myRBG.value; console.log('RBG-VALUE: ', rbgValue);

```

**So your current total code on PAGE-A would look like…**

```javascript
$w.onReady(function () {
    let selectedOption = undefined;
    let myRBG = $w('#radioGroup1');
    let rbgOptions = myRBG.options; console.log('RBG-OPTIONS: ', rbgOptions);
    let rbgValue = myRBG.value; console.log('RBG-VALUE: ', rbgValue);

    myRBG.onChange(()=>{
        rbgValue = myRBG.value; console.log('CHOSEN RBG-VALUE: ', rbgValue);
        selectedOption = myRBG.options; console.log('CHOSEN RBG-OPTION: ', selectedOption);
    });
});

```

Ok, as you can see i did already even implement some further code parts…  
**d)** New variable → which we will use for selected value ( **THIS IS WHAT YOU NEED** )

```javascript
let selectedOption = undefined;

```

**e)** _Using the → **onChange()** trigger to determine the current selection…_  
`myRBG.onChange(()=>{...});`

But if you will take a look onto all the implemented CONSOLE-LOGS (using them inside of your web-browser’s → CONSOLE \<–), you will recognize that this setup is still not complete, why ???

Because for **CHOSEN-OPTION** you still get → **all of OPTIONS** , instead of the current selected one, when you do your selection. (yes you already could work with values, but we want to make it complete right?) 🙂

 ![2025-09-27 19_42_23-HOME _ Xxxxx](https://us1.discourse-cdn.com/wix/original/3X/f/f/ff2ecf3b6b0a2baeb98e92bdbc1441dc74536a26.png)

**So, currently we already do get the selected values, but still missing the currently selected option.**

# **SOLUTION:** (After some minor modifications and upgrades…

```javascript

$w.onReady(function () {
    let selectedOption = undefined;
    let selectedLabel = undefined;
    let selectedIndex = undefined;
    let myRBG = $w('#radioGroup1');
    let rbgOptions = myRBG.options; console.log('RBG-OPTIONS: ', rbgOptions);
    let rbgValue = myRBG.value; console.log('RBG-VALUE: ', rbgValue);

    myRBG.onChange((event)=>{console.log(event);
        rbgValue = myRBG.value; console.log('CHOSEN RBG-VALUE: ', rbgValue);
        selectedOption = myRBG.options[event.target.selectedIndex]; console.log('Selected-OPTION: ', selectedOption);
        selectedLabel = event.target.label; console.log('Selected-LABEL: ', selectedLabel);
        selectedIndex = event.target.selectedIndex; console.log('Selected-INDEX: ', selectedIndex);        
    });
});

```

**Check this…**

 ![2025-09-27 20_01_46-HOME _ Xxxxx](https://us1.discourse-cdn.com/wix/original/3X/c/8/c813fa8bebef083c7e13435d1c03c638b5696bfd.png)

So which of the RGB’s OPTIONS has been chosen/selected ???

**RIGHT —\> The second one !!!**

 ![2025-09-27 20_03_16-HOME _ Xxxxx](https://us1.discourse-cdn.com/wix/original/3X/5/9/59c3982df3989a145ccfd7ef86fd35b658b012f8.png)

**Now you learned how to work with a → RADIO-BUTTON-GROUP \<— !!!**

- You have your VALUE
- You have your OPTION/LABEL
- **You even have the INDEX**!!!

# **What next ???**

![CODING-ezgif.com-resize](https://us1.discourse-cdn.com/wix/original/3X/1/a/1a9d795a7c48df4d551e295957c6994451e8b8d2.gif)  
**Now you can take those values and put them into the Wix-Storage 🙂**

---

_[View the full topic](https://forum.wixstudio.com/t/saving-radio-button-values-to-display-later-on/73660)._
