Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var old_host;
  2. var old_type;
  3. var old_prio;
  4.  
  5. // --- Meric d'ajouter plutôt un id
  6. $('.dns .col').on("click", function ()
  7. {
  8.     // --- Merci d'ajouter plutôt un id plutôt qu'une class. Vous l'avez fait pour l'host mais pour le reste.
  9.     old_host = $('#edit_host').html();
  10.     old_type = $('#edit_type').html();
  11.     old_prio = $('#edit_prio').html();
  12. });
  13.  
  14. var new_host;
  15. var new_type;
  16. var new_prio;
  17.  
  18. // --- Faut mettre l'ID du form
  19. $("form").submit(function (event)
  20. {
  21.     // --- Merci d'ajouter plutôt un id plutôt qu'une class
  22.     new_host = $('#edit_host').html();
  23.     new_type = $('#edit_type').html();
  24.     new_prio = $('#edit_prio').html();
  25.  
  26.     if (new_host != old_host && old_type != new_type && old_prio != new_type)
  27.     {
  28.         // --- Les champs sont bien différents
  29.         $("span").text("Mise à jour réussie...").toggle(true);
  30.         return;
  31.     }
  32.  
  33.     // --- Pas de champ modifiés
  34.     $('#lamerederomainelleestbonne').toggle(true);
  35.     event.preventDefault();
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement