Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  31] [ 6]  / answers: 1 / hits: 15552  / 13 Years ago, wed, june 29, 2011, 12:00:00

I want call OnClick function on page load with out user clicking. Can we do that in jQuery or javascript?



     <input name=ctl00$PlaceHolderMain$ButtonSection$RptControls$BtnSubmit 
class=ms-ButtonHeightWidth
id=ctl00_PlaceHolderMain_ButtonSection_RptControls_BtnSubmit
accessKey=o onclick=javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions(ctl00$PlaceHolderMain
$ButtonSection$RptControls$BtnSubmit,
, true, , , false, true))
type=button value=OK/>

More From » jquery

 Answers
9
$(document).ready(function() {
$(#ctl00_PlaceHolderMain_ButtonSection_RptControls_BtnSubmit).click();
});


This will trigger the click event on the element with the supplied id, and it will run when the document is fully loaded.


[#91434] Tuesday, June 28, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mariann

Total Points: 201
Total Questions: 133
Total Answers: 107

Location: Czech Republic
Member since Thu, Aug 11, 2022
2 Years ago
;