1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <input type="number" min="1" class="form-control" id="numeroBIP" name="numeroBIP" required>
<span id="erreur"></span><span id="ok"> </span></br>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(function()
{
/*alert("coucou");
});*/
$('#numeroBIP').focusout(function()
{
numeroBIP= $('#numeroBIP').val();
$.ajax({
type:"POST",
url:"DemandeBIP/demande",
data: {"numeroBIP":numeroBIP},
success:function(data)
{
if(data == 1)
{
$('#numeroBIP').next("#erreur").fadeIn().text('continuez la saisie de formulaire');
$('#erreur').next("#ok").fadeOut();
}
else
{
$('#erreur').next('#ok').fadeIn().text("ce numero existe deja dans la BD");
$('#numeroBIP').next("#erreur").fadeOut();
}
}
})
});
});
</script> |