Rectangle 27 0

jQuery Mobile onSelect ... load dialog when radio button is selected?


$('input:radio').change(function(){
   if($(this).val() == 'radio1') {
        $('#somewhere').load('path/to/page30.html')
   }
})

it detects the value of input, it's better to use a checkbox.

was looking around, wouldn't it be best to detected if radio becomes "checked" to determine when the new page loads?

Note
Rectangle 27 0

jQuery Mobile onSelect ... load dialog when radio button is selected?


$(document).on('change', '#radio11', function() {
    $.mobile.changePage('page30.html');
});
<div data-role="dialog" id="page30">
    ...
</div>
data-role="dialog"

So you always want page30 to show no matter what radio? You can only have one id. Add a class instead perhaps or just use the input[type=radio] selector.

Then use this in your javascript.

found the solution. your example is correct but jqm doesn't like file:// I had to put the files on my server and it worked. do I change all id's to "radio11" if I want the dialog box to show? will i have a conflict?

i'm using jqm 1.1.0 and yes page page30.html is in the same folder

it wants to work, I get the jqm message Error Loading Page.

ok so does page30.hmtl exist in that same directory? Also what version of JQM are you using.

Note