Jquery AjaxForm ResetForm Callback Annoyance

The last few days at work I have been using the jquery ajaxform plugin extensively. The Malsup docs have been valuable. However, there have been certain things that I have had some issue with. It might be one of those “how do you google for things that do not exist”…

Anyway, today’s hiccup was trying to execute some code when the user hits the cancel button on a form that is a ajaxForm. In the end, I wanted to hide the form when they click Cancel.

After much googling, I broke down and emailed Mike from Malsup and he got back to me right away.  He said there is no callback hook. However, he gave me  below code which is standard jquery clicke event code.  I have separate ajax to load my form, so I will need to execute this on the success of that load. Problem solved. Thanks Mike for helping me not over think this :)

$('input[type=reset]').click(function() {
    // do stuff here
});
blog comments powered by Disqus