Guest User

Untitled

a guest
May 22nd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. function editarAsigna(elem, i){
  2.  
  3. $.ajax({
  4. type: "post",
  5. url: "calls/perfil/listaSubser.php",
  6. data: "id="+i,
  7. dataType: "json",
  8. success: function(res){
  9. $('#moasig').empty();
  10. $.each(res, function (i, value){
  11. $('#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>");
  12. var a = res[i].asi.indexOf(res[i].ns);
  13. if (a >= 0) {$("input").find("#"+res[i].ns).prop( "checked", true );}else{$("input").find("#"+res[i].ns).prop( "checked", false );}
  14. });
  15. }
  16. });
  17. }
  18.  
  19. var a = res[i].asi.indexOf(res[i].ns);
  20. if (a >= 0) {
  21. $("input").find("#"+res[i].ns).prop( "checked", true );
  22. }else{
  23. $("input").find("#"+res[i].ns).prop( "checked", false );
  24. }
Add Comment
Please, Sign In to add comment