Page 1 of 1

radio button value

Posted: Wed Aug 29, 2012 1:06 pm
by yllaw

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!


radio button value

Posted: Wed Aug 29, 2012 1:27 pm
by yllaw

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);


radio button value

Posted: Wed Aug 29, 2012 6:14 pm
by maxkatz

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].


radio button value

Posted: Thu Mar 21, 2013 7:09 pm
by David Andrews

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


radio button value

Posted: Thu Mar 21, 2013 7:28 pm
by Maryna Brodina