The following code will submit the ajax form when the user presses ctrl + enter while in the feedback input area. It works great, but only once. I need to bind this function to the comment form so that it persists and allows for multiple views. In other words, the form is cleared and presented to the user after each submission. However, the following code only works for the first view, and therefore ctrl + enter does not work for the second view.
$('#comment_body').keydown(function(e) {
if (e.ctrlKey && e.keyCode === 13) {
return $('#comment_submit').trigger('submit');
}
});
I tried .live and .bind but cannot get the syntax to allow resubmission.
thank
source
share