I have code but the alert message is not working. Using Firefox - not sure if that is the problem. Appreciate help please .. new at this.
The code I have:
$("#enquiry").on("click",function(){
$.ajax({
url: "<?php echo base_url(); ?>product/enquiry/<?php echo $type;?>",
data: $("#enquiry_form").serialize() ,
type: "POST",
dataType: "json",
success: function(data) {
console.log(data);
if (data.status == true) {
//show success message
alert(data.msg);
$('#enquiry_form')[0].reset();
$('.error').html('');
}else{
$.each(data.errors, function(key, val) {
console.log(val);
$('[id="span_'+ key +'"]').html(val);
});
}
}
});
});
I have changed various parts of the call and tested enquiry forms but still no alert when button is clicked. The customer enquiry form comes through but because they do not get an alert when they click the button they keep clicking and we receive multiple copies of the same form.
I was able to find the issue - there was a typo in the table column title. So I assume the form was not able to resolve the query which effected the alert notification from activating.