I have a form with a disabled submit via return false
on form submission.
The problem is that I want to store data with ajax
. When I applied ajax
it's submitting the form which I don't want.
This is my jquery function.
function RegisterCourse(form)
{
$('.barlittle').show();
var all_data = $('#'+form).serialize();
$.ajax({
url:AjaxRecord.php,
type:get,
data:'all_data='+all_data,
success:function(response){
$('.barlittle').hide();
var mesg="Successed";
$('#temp').val(mesg);
return false;
},
error:function(){
$('.barlittle').hide();
var error="ERROR";
$('#temp').val(error);
return false;
}
});
return false;
}
url:AjaxRecord.php,
is probably causing a syntax error. Check your JS console.