see below my code e.prevnt default not working the form got submited :
this is the modal its working without any probleme the only issue is preventing submition
so I need your help please take a look at this and let me know
<div id="Edit-ROT" class="modal fade" tabindex="0" role="dialog" aria-labelledby="add-contactLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="add-contactLabel">Modifier Recommandation OT</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="statusMsg"></div>
<div class="alert alert-success alert-dismissible" id="success" style="display:none;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
</div>
<form id="ModifierROT" action="" method="post" >
<input type='hidden' name='ajouter' value='modifier_rot'/>
<input type='hidden' name='ideditROT' id='ideditROT' value=''/>
<div class="modal-footer">
<button type="button" class="btn btn-default " data-dismiss="modal">Cancel</button>
<input type="submit" class="btn btn-primary " id='submitbtn' name="ajouter_caution" value="Enregistrer">
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div><!-- /.modal -->
</div><!-- /.modal -->
this is the JS its working without any probleme the only issue is preventing submition
so I need your help please take a look at this and let me know if you require any further help
// Modifier ROT
$("#Modifierrot").on('submit', function(e){
e.preventDefault();
$.ajax({
type: 'POST',
url: 'caution/nouvelle_caution.php',
data: new FormData(this),
dataType: 'json',
contentType: false,
cache: false,
processData:false,
beforeSend: function(){
$('.submitBtn').attr("disabled","disabled");
$('#Modifierrot').css("opacity",".5");
},
success: function(response){
$('.statusMsg').html('');
if(response.status == 1){
$('#Modifierrot')[0].reset();
$('.statusMsg').html('<p class="alert alert-success">'+response.message+'</p>').delay(5000).fadeOut('slow');
}else{
$('.statusMsg').html('<p class="alert alert-danger">'+response.message+'</p>');
}
$('#Modifierrot').css("opacity","");
$(".submitBtn").removeAttr("disabled");
},
error : function(request, status, error) {
var val = request.responseText;
alert("error"+val);
}
});
});