asp.net - jQuery server-side button -


I have a button (ASP.NET 3.5), many of which are buttons, some of them are saving buttons, Nothing is there. I have to be normal, i.e. different controls by ID can not be called. My save button will probably be a member of the user's user = type = save = right click event event handler, which type of button should be pressed, so:

  $ ('input [type = Submit] '). Bind ('click', function (e) {// If you need to know how to establish this situation (this.type = "submit") {// do something here} else {// do something else} });  

How can I do this?

If I understand correctly, you have multiple types of buttons, both regular and submitted Please. You can do this in a function such as:

  $ ('input [type = submit], input [type = button]'). Bind ('click', function (e) {If ($ (this) .attr ('type') == "submit") {// do something here} else {// do something else}});  

You can break it in a more readable way:

  $ ('input [type = button]'). Bind ('click', function (e) {// do button stuff here}}; $ ('input [type = submit]'). Bind ('click', function (e)) });  

Personally, I like the second method.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -