javascript - Get value/id of activated input in an ASP MVC Ajax.BeginForm OnBegin method -


My ASP is using the MVC CSMTM code

  (Ajax Begiefform (" Action "," controller ", new {para = 123}, new Ajax option {HttpMethod =" POST ", OnBegin =" DoOnBegin ",})) {& lt; Input type = "submit" value = "foo" id = "fooSubmit" /> & Lt; Input type = "submit" value = "bar" id = "barSubmit" /> }  

and javascript

  function DoOnBegin () {if (the value of active input element == "foo") {// something to do} other {// do something else}}  

Is it possible to get the value of the input element that was clicked and if so, how? $ (This) element only contains the form, but it seems that I can not find the selected input

Either a clean javascript or a jquery solution will be corrected


Comments