“I have one radio button contain only one checkbox option.” Are you using a Radio Button group or a checkbox? It’s not clear to me.
Note that session storage saves strings . If the value of your radio/checkbox is a number, or true/false, then it won’t work. You will need to convert the value to a field.
I’m using radioGroups.
The value of my radiobuttons are text, and are connected to text fields in the database.
The session storage works in scenarios where radioButtonGroup contains more options, but since I only have one option in each Radiogroup, the session storage doesnt work…
First of all, since you only have one option, a Checkbox is probably your best bet.
If you really, absolutely, positively must have a Radio button, then… What is the value that’s being returned? You can use a console.log(city) to see the value.
In the console log it shows the name of the city chosen. (JAPAN, SINGAPORE)
I should probably have used checkboxes like you said. Although I tried that now, but I get the same issue as with the radio buttons.
The reason why I chose to only have one option in each group, was because I wanted to have an individual on change event for each option. As I’m new to coding, I couldn’t figure out how to set that up.
So I made more groups with only one option, and made them all point to the same databasefield, so that only one answer would be submitted (selecting one button unchecks the other).
But this is where the session storage problem begins, as soon as those buttons are connected to the same field in the database.
I gotta admit, I’m a bit confused. I think that I need to see up close what’s going on. Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor.Please include the name of the page involved.
@yisrael-wix Thanks for having a look. I want it to remember the users choice when you click next page, and return. Isn’t that what session storages is for? Now if you choose JAPAN go to next page, and then back, SINGAPORE is checked…
@yisrael-wix Hey. sorry for keep whining about this, but I’m really eager to figure this out. You’ve been tremendously helpful already, could you please show me how to get that if statement correct?
It’s getting the correct value, but visually it keeps checking “SINGAPORE”.