日期:2014-05-16 浏览次数:20670 次
$("#rolelist_form #select_user").change(function(){ var uid=$("#rolelist_form select :selected").val(); //获取所有的checkbox元素 var objs=$("#rolelist_form div[id=rolelist] input[id=select_role]"); $.getJSON("../CRM/Action/checkuser_role.php",{id:uid}, function(data){ if(data["roleid"]==null){ for(var j=0;j<objs.length;j++){ objs[j].checked=false; objs[j].disabled=false; } }else{ for(var i=0;i<objs.length;i++){ if(data["roleid"]==parseInt(objs[i].value)){ objs[i].checked=true; objs[i].disabled=true; }else{ listSpecialPrefix.jsp</result> <result name="input">/baseset/listSpecialPrefix.jsp</result> </action> </package> </struts>
$uid=$_GET["id"]; $urtdao=new UserRoleTempDAO(); $urtarray=$urtdao->checkUserByRole($uid); if(count($urtarray)!=0){ $json=json_encode($urtarray); echo $json; }else{ $urtarray["roleid"]="null"; $json=json_encode($urtarray); echo $json; }
if(data["roleid"]==null||data["roleid"]=="")
------解决方案--------------------
你alert(data["roleid"]);看是什么值,也许data["roleid"]=="";