I am trying to submit the form with jquery. I am using bootstrap modal window. Here is a js fiddle. Am i missing something? thanks alot
Update: I am trying to submit the form using ajax.
I also tried but not luck.
$('#comment_form').on('submit', function(){
$.post("/yourReceivingPage", $(this).serialize(), function(){
// Hide the modal
$("#my-modal").modal('hide');
});
// Stop the normal form submission
return false;
});
You refer to the wrong element, I have a working example for you, please check and let me know if it works for you:
jsFiddle Working Demo
And for AJAX solution you need to refer to familiar and already discussed issue:
jquery serialize and $.post
Edited: Referring to your question about how to extract the ID of the clickable link, this code will do it for you:
});
jsFiddle live demo