I've created the radio button for jQuery mobile, I already declare the variable and the value, but why is not reflect, can anybody help I tried many time with different code but still didn't work.
Here is live code
var type = "Contractor";
$('input[name=CustCat]').filter('[value=Contractor]').attr('checked', true);
Many thank ahead.
Sorry i am also a noob son i cant totally understand your meanings.But i guess you can't select the radio button which you choose,try this.If i misunderstood you question,please let me knowXD
$("#Architect").change(function(){
if ($(this).prop("checked")){
alert("you choose Architect");
$('input[name=CustCat]').filter('[value=Architect]').attr('checked', true);
};
if($(this).prop("checked")==false){
alert("you cancel Architect");
$('input[name=CustCat]').filter('[value=Architect]').attr('checked', false);
}
});
and your $("#ul-CustTypeDisplay").enhanceWithin();
show error,so i turn it into comment,and it really works.
http://jsfiddle.net/techsin/snj4heoz/
here you need to remove ui-radio-off
class then ad ui-radio-on
class.
var inputs = $('input[name=CustCat]');
inputs.filter('[value=' + type + ']').first().attr('checked', true).siblings('label').removeClass('ui-radio-off').addClass('ui-radio-on');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.