diff --git a/Js/fonctions.js b/Js/fonctions.js index 103cb2ce..1977e5af 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -49552,29 +49552,31 @@ function retour_colleges_types() } -function nouveaucollegetype(){ - donnees = ''; - $.ajax({ - url: $("#racineWeb").val()+"Ajaxnouveaucollegetype/", - type : 'post', - data: donnees, - error: function(errorData){ - alert("Erreur : "+errorData); - }, - success: function(data) { - //alert("Success : "+data); - $('#div_nouveaucollegetype').html(data); - $('#div_nouveaucollegetype').modal("show"); - $('#div_nouveaucollegetype').on('shown.bs.modal', function(){ - stylechampsRequis(); - $('#codeCollegeType').focus(); - }); - }, - complete: function() { - - } - }); -} +function nouveaucollegetype() { + let racineWeb = $("#racineWeb").val(); + + $.ajax({ + url: racineWeb + "Ajaxnouveaucollegetype/", + type: 'post', + data: {}, + beforeSend: function() { + // Optionnel : afficher un loader global ou désactiver le bouton appelant + }, + success: function(data) { + let $modal = $('#div_nouveaucollegetype'); + $modal.html(data); + $modal.modal("show"); + + $modal.on('shown.bs.modal', function() { + // Focus sur le premier champ pour une saisie immédiate + $('#libelle').focus(); + }); + }, + error: function(xhr) { + alert_ebene("Erreur lors de l'ouverture du formulaire", "Error opening the form"); + } + }); +} function ajoutercollegetype(){ diff --git a/Vue/Ajaxnouveaucollegetype/index.php b/Vue/Ajaxnouveaucollegetype/index.php index 9d10fb96..723ff342 100755 --- a/Vue/Ajaxnouveaucollegetype/index.php +++ b/Vue/Ajaxnouveaucollegetype/index.php @@ -1,40 +1,68 @@ - - \ No newline at end of file + + + \ No newline at end of file