Using wix storage with radio buttons

Hey,

I have two radio buttons on my page, a simple yes or no option

These two buttons are separate elements, as I want to have different onchange events applied to them, but they are still linked to the same column in the dataset. So only 1 option can be chosen.

I’m trying to set up the wix session storage, so that when you select an option and go to next page, you can go back to the previous page and your option is still selected.

For some reason the session storage only stores the value if the user selected the “no” button.
If I select “yes” and go back, “no” is checked again.

The settings on each buttons are the same.

This is my current code:


import { session } from ‘wix-storage’;

$w.onReady( function () {
//TODO: write your page related code here…

$w('#ja1').value = session.getItem("human"); 
$w('#nei1').value = session.getItem("human2"); 

});

export function ja1_change(event) {
//Add your code for this event here:
let human = $w(‘#ja1’).value
session.setItem(“human”, human);
}

export function nei1_change(event) {
//Add your code for this event here:
let human2 = $w(‘#nei1’).value
session.setItem(“human2”, human2);
}

Thank you!

If anyone has any idea how to solve this issue, I would be grateful!