Guest User

Untitled

a guest
Dec 14th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. case 'Parametrage':
  2. $("#container").empty();
  3. $("#container").load("params");
  4. break;
  5.  
  6. $(function(){
  7. $('body').on('submit', 'form', function(e){
  8. e.preventDefault();
  9.  
  10. $.ajax({
  11. type: "POST",
  12. url: "<?php echo site_url("params/save_form"); ?>",
  13. data:$(this).serialize(),
  14. success: function(response){
  15. if(response == 'true'){
  16. $.modal.close();
  17. var table = $('#table_id').DataTable();
  18. table.ajax.reload();
  19. $('#dialog-message').attr('title','Enregistrement');
  20. $('#msgIcon').attr('class','ui-icon ui-icon-circle-check');
  21. $('#msgMessage').html('Enregistré avec succès');
  22. $("#dialog-message").dialog({
  23. modal: true,
  24. buttons: {
  25. Ok: function() {
  26. $(this).dialog("close");
  27. }
  28. }
  29. });
  30. }else{
  31. $('#errors_container').html(response);
  32. }
  33.  
  34. },
  35. error: function(){
  36. alert('Error');
  37. }
  38. });
  39. });
  40. });
  41.  
  42. case 'Parametrage':
  43. $("#container").empty();
  44. //Added this line
  45. $('body').off("submit", "form");
  46. $("#container").load("params");
  47. break;
  48.  
  49. $(body).off("submit", "form");
  50.  
  51. url: "<?php echo site_url("params/save_form"); ?>",
  52.  
  53. url: '<?php echo site_url("params/save_form"); ?>',
  54.  
  55. url: "<?php echo site_url("params/save_form"); ?>",
  56.  
  57. url: "<?php echo site_url("params/save_form"); ?>"
  58.  
  59. url: "<?php echo site_url('params/save_form'); ?>",
  60.  
  61. url: '<?php echo site_url("params/save_form"); ?>',
Add Comment
Please, Sign In to add comment