Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Get the selected value from Radio Select

Hi

I have the UI component Radio and one button

I have some options on the radio.

I need to save as local variable the option selected on the radio and run this when i click on the button.

I have this JS in the button.

var a = $('[name=radio_list]').val();
localStorage.setItem('_value', a);

All time only have the first option. If I no have item selected i have the first option too.

What is the correct function ?

Thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Get the selected value from Radio Select

Hi Jordi,

You can use this JS:prevar val = Appery("mobileradiogroup").find(":checked").val();/preWhere 'mobileradiogroup' is a name of radiogroup component.

Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Get the selected value from Radio Select

thanks Katya :)

Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Get the selected value from Radio Select

One more question about this.

When i use the Radio select, how can i reset it with no option selected? And how can i change with JS the option to other?

I know how to do this with Select but it's different for Radio.

Thanks for your time

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Get the selected value from Radio Select

Hi Jordi,

You can use this code:preAppery("mobileradiogroup").find(":checked").attr("checked", false);/pre

Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Get the selected value from Radio Select

thanks Katya this change the value. Then need to refresh the "mobileradiogroup" with .checkboxradio("refresh");

I will try to change the option selected with other button now

thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Get the selected value from Radio Select

Jordi,

Let us know if you need any help.

Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Get the selected value from Radio Select

for any one who have this problem here is one solution:

$('input:radio[name="list"]').filter("[value="+input+"]").prop("checked", true).checkboxradio( "refresh" );

Return to “Issues”