jQuery: Perform a clean submit by removing hidden divs
I am trying to perform a 'clean' submit, i.e. a submit that is invoked
after removing all hidden divs from the form field.
Since this is a feature I am going to use more often, I shiftet my code
into the extend-part:
$.fn.extend({
bindCleanSubmit: function() {
$(this).submit( function(event) {
event.preventDefault();
$(this).find("div:hidden").remove();
console.log("trying to commit...");
return true;
});
}
});
Now, all divs are removed, the console event is triggered but at the end
the submit has not performed.
Do you now the problem here?
Thanks a lot!
No comments:
Post a Comment