jquery - Value of submit button clicked -


This should really be straight forward.

I am finding out whether a form jquery The form contains multiple submit buttons with multiple prices:

  & lt; Button type = "submit" value = "foo" & gt; Foo & lt; / Button & gt; & Lt; Button type = "submit" value = "bar" & gt; Bar & lt; / Button & gt;   

I would like to find the value of the button that has just submitted the form:

  $ (form) .live ('submit', function () {// Get the value of the submit button}   

thanks

Tie event to submit button instead of form and then in the context of $ (this) button ...

  $ (": Submit.") Live (' Click ', function () (warning ($ (this) .val ());})   

edit as jQuery 1.7 has been used . I Instead of use.

  $ (document) .on ("click", "submit", function (e) {warning ($ (this) .val ());});    

Comments