I have a function:
function blur_slide_visit_count(){
$.ajax({
type: 'POST',
url: 'add_save_slide_visitor_count.php',
async: false,
data: { fillvalue: fieldArray },
success : function(){}
});
}
I also have an element:
<input class="btn btn-default btn1" type="submit" id="submit-btn">
I've attached a listener to the input that calls the function:
$("#submit-btn").click(function() {
blur_slide_visit_count();
$("form").submit();
});
What I expect to happen is that when the user clicks the input, the function is called and the AJAX executes which calls the PHP page which should update my DB. But, when I click the button, the DB never gets updated. I think the AJAX call is dropping, but I don't know why.
Can anyone help explain why the above code isn't working?