Can I intercept/interrogate the form submission values using jQuery in the $('#formid').submit(function() { }); call? I can’t check the value from the page as it’s the particular submit button pressed that I need to check. I’ve found this Link and it works in FF, but not in IE8, so that doesn’t help, unfortunately. I also don’t want to have to attach submit code to the buttons as I was hoping to make a generic bit of code I could plug into a whole set of forms.
Cheers
MH
The latest jQuery 1.4 supports ‘live’ for submit events now — meaning you don’t have to attach individual handlers to all your forms. A nice example that covers what you’ve asked is given by Paul Irish here:
http://jquery14.com/day-05/jquery-1-4-hawtness-1-with-paul-irish
Here’s my own take:
HTML:
http://jsbin.com/equho3/6/edit
EDIT – Sorry, I posted an example here that matched the one in your link! I’ve now provided a cross-browser solution.