yllaw
Posts: 0
Joined: Fri Apr 27, 2012 7:44 am

radio button value

hi, I like to know about how to get the value of radio button and It's possible to put the value in text input? thanks in advance!

yllaw
Posts: 0
Joined: Fri Apr 27, 2012 7:44 am

radio button value

anyway I already solved it sorry, here my answer to my question, he3x for the benefit of others out there

code:
//for the text input
var getval= Tiggr('mobiletextinput1');

//getting the value of radio button
var choose1 = $('input:radio[name=mobileradiogroup1]:checked').val();

//passing the value
getval.val(choose1);

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

radio button value

Thanks for posting this. Some additional notes.

Tiggzi(..) is the same as Tiggr(..).

code
Tiggzi('mobiletextinput1');
/code

is the same as:

code
$('input[dsid="mobiletextinput1"]');
/code

note that 'input' is the element type, so it might be different, depending on what you are trying to select.

code
Tiggzi('mobiletextinput1');
/code
you will get a jQuery Mobile element. To get the value:

code
Tiggzi('mobiletextinput1').val();
/code

If you want to get a value of label component, then .text() should be used:
code
Tiggzi('mobiletextinput1').text();
/code

Tiggzi(..) is just a helper function. Everything else is just plain jQuery (http://api.jquery.com/) and jQuery Mobile ([url=http://jquerymobile.com)]http://jquerymobile.com)[/url].

David Andrews
Posts: 0
Joined: Mon Mar 11, 2013 10:04 pm

radio button value

Can you also explain how to set a specific button in a radio group to be checked programmaticly?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

radio button value

Return to “Issues”