Advertisement
yesamarcos

Confirm várias vezes

Nov 4th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         $(document).on('blur', '.edit_descr > span', function(event){
  2.             event.preventDefault();
  3.             /* Act on the event */
  4.             var descricao = $(this).text();
  5.             var metodo_id = $(this).data("metodo_id");
  6.             if(descricao && metodo_id){
  7.                 if(confirm("Deseja realmente atualizar a descrição desta função no sistema?") == true){
  8.                     $.ajax({
  9.                         url: '/permissoes/alterardescricao', type: 'POST', dataType: 'json',
  10.                         data: {descricao: descricao, metodo_id: metodo_id},
  11.                         success: function(ret){
  12.                             console.log(ret);
  13.                         }
  14.                     });
  15.                 }
  16.             }
  17.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement