add button spinner
This commit is contained in:
parent
d0715b0d15
commit
68b137c8f9
1 changed files with 17 additions and 2 deletions
|
@ -34,7 +34,7 @@
|
|||
<div id="methodPto" class="collapse show testMethods">
|
||||
|
||||
<h2 class="text-center form-title">Test d'éligibilité par PTO</h2>
|
||||
<form method="post" action="/test/pto">
|
||||
<form id="formPtoTest" method="post" action="/test/pto">
|
||||
<div class="form-group" id="ptoForm">
|
||||
<label class="form-label" for="pto-number">Numéro PTO</label>
|
||||
<input autofocus required type="text" class="form-control" name="pto" id="pto-number" aria-describedby="ptoHelp"
|
||||
|
@ -53,7 +53,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-sable">Tester le PTO</button>
|
||||
<button id="buttonPtoTest" type="submit" class="btn btn-sable">Tester le PTO</button>
|
||||
</form>
|
||||
|
||||
<br>
|
||||
|
@ -208,10 +208,25 @@
|
|||
});
|
||||
|
||||
$('#formAddressTest').submit(function(eventObj) {
|
||||
// disable button
|
||||
$("#btnTestAdresse").prop("disabled", true);
|
||||
// add spinner to button
|
||||
$("#btnTestAdresse").html(
|
||||
`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>Test...`
|
||||
);
|
||||
$('#formAddressTest').append(`<input type="hidden" class="form-control" name="codeInsee" value="${codeInsee}" />`);
|
||||
$('#formAddressTest').append(`<input type="hidden" class="form-control" name="codeRivoli" value="${codeRivoli}" />`);
|
||||
return true;
|
||||
});
|
||||
$('#formPtoTest').submit(function(eventObj) {
|
||||
// disable button
|
||||
$("#buttonPtoTest").prop("disabled", true);
|
||||
// add spinner to button
|
||||
$("#buttonPtoTest").html(
|
||||
`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>Test...`
|
||||
);
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue