Handle ajax errors on SIRET form
This commit is contained in:
parent
a17ac5a9db
commit
2fc03e9079
1 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
||||||
$(document).on('turbolinks:load', the_terms);
|
$(document)
|
||||||
|
.on('turbolinks:load', the_terms)
|
||||||
|
.on('turbolinks:load', handle_siret_form_errors);
|
||||||
|
|
||||||
function the_terms() {
|
function the_terms() {
|
||||||
var the_terms = $("#dossier_autorisation_donnees");
|
var the_terms = $("#dossier_autorisation_donnees");
|
||||||
|
@ -41,3 +43,13 @@ function toggle_etape_1() {
|
||||||
$('.row.etape.etape_1 .etapes-menu #logos').toggle(100);
|
$('.row.etape.etape_1 .etapes-menu #logos').toggle(100);
|
||||||
$('.row.etape.etape_1 .etapes-informations #description_procedure').toggle(100);
|
$('.row.etape.etape_1 .etapes-informations #description_procedure').toggle(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handle_siret_form_errors() {
|
||||||
|
$(".form-inline[data-remote]").on("ajax:error", function(event) {
|
||||||
|
var input = $('#dossier-siret', event.target);
|
||||||
|
if (input.length) {
|
||||||
|
var invalid_siret = input.val();
|
||||||
|
error_form_siret(invalid_siret);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue