Guest User

Untitled

a guest
Feb 18th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. $("#save").on('submit',(function(e) {
  2. e.preventDefault();
  3.  
  4. var formString = new FormData($("#preview")[0]);
  5.  
  6. //Aqui necesito cambiar el estatus dependiendo de cual boton se dio click
  7. formString.append('status', 'IP');
  8.  
  9. $("#save").prop('disabled', false);
  10. $("#make").prop('disabled', false);
  11.  
  12. $.ajax({
  13. url: "<?php echo URL ?>"+"items/emp_make",
  14. type: "POST",
  15. data: formString,
  16. contentType: false,
  17. cache: false,
  18. processData: false,
  19. dataType: 'json',
  20. success: function(data){
  21. $("#save").prop('disabled', false);
  22. $("#make").prop('disabled', false);
  23. if (data.status == true) {
  24. swal({
  25. position: 'top-end',
  26. type: 'success',
  27. title: data.msn,
  28. showConfirmButton: false,
  29. timer: 1500,
  30. customClass: 'content-header-center'
  31. });
  32. setTimeout(function(){
  33. window.location.replace("<?php echo URL ?>ver/"+data.id);
  34. }, 1900);
  35. }
  36. },
  37. error: function(data){
  38. console.log(data)
  39. console.error('error');
  40. }
  41. });
  42. }));
Add Comment
Please, Sign In to add comment