Is there an “after submit” jQuery option?

If you have no other handlers bound, you could do something like this:

$('#imageaddform').submit(function(e) {
    e.preventDefault(); // don't submit multiple times
    this.submit(); // use the native submit method of the form element
    $('#imagefile').val(''); // blank the input
});

Leave a Comment