Advertisement
JoanMarcos

Untitled

Jun 1st, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //list ao usuarios
  2. $('select[name=Usuario_ID]').change(function () {
  3.             var idUsuario = $(this).val();
  4.             $.get('/grupos/' + idUsuario, function (grupos) {
  5.                 $('#Tabela > tbody').empty();
  6.                 $.each(grupos, function (key, value) {
  7.                     $('#Tabela > tbody:last-child').append(
  8.                     '<tr>' +
  9.                         '<td>' + value.Grupo_ID + '</td>' +
  10.                         '<td>' + value.Grupo_Nome + '</td>' +
  11.                         '<td> <input type="checkbox" name="Grupo_ID" id="grupo" value="'+value.Grupo_ID+'"> </td>' +
  12.                     '</tr>'
  13.                     );
  14.                 });
  15.             });
  16.         });
  17. //method para cadsatro
  18.         $("#Associ").on('submit', function (e) {
  19.             e.preventDefault();
  20.             $.ajax({
  21.                 type: "POST",
  22.                 url:"PostTesteAsso",
  23.                 dataType : "json",
  24.                 headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
  25.                 data : $(this).serialize(),
  26.             });
  27.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement