Page 1 of 1

Cannot read the selected radio button into localstorage

Posted: Thu Oct 02, 2014 9:46 am
by Hawk

I am using the following JS on "value change" for radio group that locates in a panel:

code
var checkedRadio = Appery("mobileradiogroup_215").find(":checked").val();
localStorage.setItem("month", checkedRadio);
/code

I need to copy the value of the selected button (regardless which one is selected) into the LSV. The radiogroup name is correct, and LSV is created and had a value of "To Date" by default. However, when I click on any button , LSV gets the value "undefined" (I monitor it using chrome dev tools).

The value that I need to copy is the value I set here:

Image

Is there anything wrong in my JS?


Cannot read the selected radio button into localstorage

Posted: Thu Oct 02, 2014 10:41 am
by Kateryna Grynko

Hi Hawk,

You could set localStorage variable value on Value change event as follows:
Image


Cannot read the selected radio button into localstorage

Posted: Thu Oct 02, 2014 11:28 am
by Hawk

Hi Kateryna,

I followed that :

Image

And I wanted to check the value stored in the LSV, so I added:

Image

However, when I check any of the radio button, the alert returns "null" value !

To reproduce:
Link: http://appery.io/app/mobile-frame?src...

credentials: 1234/star1234

Navigate: NavBar: Points -- click on the button (2) in described in the screenshot below, panel will open, which contains the radiogroupbuttons.

Image

Image


Cannot read the selected radio button into localstorage

Posted: Thu Oct 02, 2014 4:25 pm
by Evgene Karachevtsev

Hello Hawk,

I don't see that some variable appeared with ls, and therefore it receives null,
Could you please send us the screenshots of all the events together?


Cannot read the selected radio button into localstorage

Posted: Wed Mar 04, 2015 11:12 am
by Laura Eadie

Try this:

var checkedRadio = $( '.ui-radio-on' ).parent().find('input').val();