javascript - Get value/id of activated input in an ASP MVC Ajax.BeginForm OnBegin method -
javascript - Get value/id of activated input in an ASP MVC Ajax.BeginForm OnBegin method -
my asp mvc cshtml code
using (ajax.beginform("action", "controller", new {para=123}, new ajaxoptions { httpmethod = "post", onbegin = "doonbegin", })) { <input type="submit" value="foo" id="foosubmit" /> <input type="submit" value="bar" id="barsubmit" /> }
and javascript
function doonbegin() { if(value of activated input element == "foo"){ // } else { // else } }
is possible value of input element clicked , if is, how? $(this) element contains form seems can't selected input.
either pure javascript or jquery solution fine
javascript jquery asp.net ajax asp.net-mvc
Comments
Post a Comment