Page 1 of 1

Can a button be clicked using events?

Posted: Mon Apr 12, 2021 4:16 pm
by lummis
I would like a button to be clicked automatically once a page has been loaded. I have looked at onload events but can't find a suitable option and suspect that I might need a separate script. Has anyone any suggestions as to how this might be achieved?

Brian

Re: Can a button be clicked using events?

Posted: Mon Apr 12, 2021 4:40 pm
by BaconFries
Has anyone any suggestions as to how this might be achieved?
Without sounding rude in anyway what so ever "Google"
Couple of examples
https://forums.asp.net/t/2069637.aspx?H ... ge+is+load+
https://stackoverflow.com/questions/539 ... d/53981378

button to be clicked automatically once a page has been loaded
https://www.google.com/search?q=button+ ... e&ie=UTF-8

Re: Can a button be clicked using events?

Posted: Mon Apr 12, 2021 6:18 pm
by lummis
No offence taken BF - I had carried out a few searches (using Bing) but none seemed to give a definitive answer. I will explore your suggestions to see if I can get one to work.

I had hoped that there might have been an "off the shelf" solution that I had missed - perhaps just wishful thinking :)

Re: Can a button be clicked using events?

Posted: Mon Apr 12, 2021 7:08 pm
by lummis
Thanks for your suggestions BF and I am pleased to say that I have got the following script to work

Code: Select all

<script>
window.onload=function(){
$("#Button1").click();
}
</script>
Now all I have to do is to get the sequence of events in the right order!

Brian

Re: Can a button be clicked using events?

Posted: Mon Apr 12, 2021 8:40 pm
by BaconFries
Glad to have helped