How can i submit a form using jquery, my form is loaded on the bootstrap popover. I tried the below jquery code but its NOT submitting the form
Ex. I have to submit be
Demo
You need to move validate part out of from popover and put it onclick event like;
$('.add_btn').popover({
html: true,
title: function () {
formidd=$(this).parent().find('.projform_id').text();
return $(this).parent().find('.sub_proj_head').html();
},
content: function() {
return $(this).parent().find('.sub_proj_content').html();
}
});
$('.add_btn').click(function(e) {
$('.add_btn').not(this).popover('hide');
e.stopPropagation();
var formidd=$(this).parent().find('.projform_id').text();
console.log(formidd)
$("#"+formidd).validate({
rules: {
sproject_name: {
minlength: 3,
maxlength: 15,
required: true
}
},
submitHandler: function(form) {
alert("hi");
$(form).ajaxSubmit();
}
});
});
And put submit button in your forms.