Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Get checked mobile radio button text

I am mapping a service to a radiogroup and want to get text of the the checked radio button. I was suggested the following code which was working completely fine, but after migrating to V2.0 libs this no longer works for me.

Could you suggest what is wrong - I've also posted this to support@appery with a bit more background and steps to replicate the problem in my project.

Many thanks - look forward to your feedback!

//execute on success of event:
$('[dsid="RadioButton"]').eq(1).find('input').prop("checked", true).checkboxradio("refresh");
//and this code to read value of checked button
var addr = $('input[name=RadioGroup]:checked').next().find(".ui-btn-text").html();

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Get checked mobile radio button text

Hello Cody,

Please check API examples for Radio button in this doc http://devcenter.appery.io/documentat...

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Get checked mobile radio button text

Alena.

I had checked the documentation. I need to get the text associated with the checked radio button. I have tried all following combinations, and get an empty response.

alert($('input[name=RadioGroup]:checked').next().text());
alert($('input[name=RadioGroup]:checked').text());
alert($('input[name=RadioGroup]:checked').next().find("ui-btn").html());

What do you suggest? Thank you for your prompt feedback!!

As indicated, I've also sent an email to appery@support to reproduce the issue.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Get checked mobile radio button text

Cody,

For Radio button group on Value change event run this JavaScript:
prealert($('input[name=radio_group]:checked').val());/pre

Where radio_group - you Radio button group name

Cody Blue
Posts: 0
Joined: Sun Aug 25, 2013 2:11 am

Get checked mobile radio button text

Alena,

I do not need the value associated with the button, what I need is the text (which is mapped by a rest service to the radiogroup).

I am going to send an email to support@appery pointing out the details.

Could you then pls advise at your earliest convenience?
Regards.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Get checked mobile radio button text

Hi Cody,

Please use following code to get selected radiobutton text:

pre

//Note: you need replace: "radioGroupComponentName" with your component name.
var selectedRadioText = $('input[name=radioGroupComponentName]:checked').closest("div").find("label").text().trim();

alert("selectedRadioText = " + selectedRadioText);

/pre

Regards.

Return to “Issues”