Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function editarAsigna(elem, i){
- $.ajax({
- type: "post",
- url: "calls/perfil/listaSubser.php",
- data: "id="+i,
- dataType: "json",
- success: function(res){
- $('#moasig').empty();
- $.each(res, function (i, value){
- $('#moasig').append("<label><input type='checkbox' id='"+res[i].ns+"' onchange='alistaAsiganciones(this,""+res[i].ns+"","+res[i].du+");'> "+res[i].ns+" - "+res[i].pa+"</label><br>");
- var a = res[i].asi.indexOf(res[i].ns);
- if (a >= 0) {$("input").find("#"+res[i].ns).prop( "checked", true );}else{$("input").find("#"+res[i].ns).prop( "checked", false );}
- });
- }
- });
- }
- var a = res[i].asi.indexOf(res[i].ns);
- if (a >= 0) {
- $("input").find("#"+res[i].ns).prop( "checked", true );
- }else{
- $("input").find("#"+res[i].ns).prop( "checked", false );
- }
Add Comment
Please, Sign In to add comment