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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -