Jquery and trigger a click on a hidden button

How about

$("#buttonid").click();

$('#myHiddenButton').trigger("click");

Or just

$('#myHiddenButton').click();

See Events/Trigger


For the Webform: if you set the Visible property to false; typically in .net the control will not be rendered in the HTML output after the page is processed. Therefore as far as jQuery is concerned, the button does not exist.

You can do a View Source on the page to verify this.

If you want to do this, instead of using the Visible property, you can do something like:

<asp:Button ID="HiddenButtonID" runat="server" style="visibility: hidden; display: none;" />

Then you can using jQuery to click button as :

$("#HiddenButtonID").click(); //Remember that in button, you must set ClientIDMode = "static"

or

$("#<%=HiddenButtonID.ClientID%>").Click();

Tags:

Asp.Net

Jquery