Why does not this JavaScript work?
JavaScript code:
$('#basic_validate').submit(function(e) {
document.getElementById('successmsg').style.display = 'none';
document.getElementById('errormsg').style.display = 'none';
e.preventDefault();
$.ajax({
type: "POST",
url: "../suppliers/resources/controllers/register.php",
async: true,
data: $(this).serialize(),
success: function(data) {
},
complete: function(result){
if(result == true){
//clear inputs
document.getElementById('successmsg').style.display = 'block';
}else{
document.getElementById('errormsg').style.display = 'block';
}
}
});
});
HTML code:
<form class="form-horizontal" method="post" name="frmLogin" id="frmLogin">
//text_inputs