Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
Hi!

I'm stuck with some problems regarding HTML onclick event handler.
I really need to get this function to be executed in a WebBrowser control inside my Windows form.
HTML
<a href="#" onclick="sendstickyto(); document.sendmail.submit(); return false;" class="action-button">SendMessage</a>

Im executing this function in Chrome Console and it works perfectly, but i need to do the same in my windows form.
I guess there is a way to execute the "onclick" event ? :)

Thanks for any help !
Posted
Updated 9-Nov-11 2:36am
v4

The onclick function you're trying to executre is a javascript function. If you were to use Wireshark to analyze what the page does when the user clicks abutton, you will be able to figure out the correct querystring to pass to make the right things happen. BTW, wireshark is a free tool, and google is your friend.
 
Share this answer
 
Comments
Haugli92 8-Nov-11 8:55am    
Thanks.. i know what wireshark is :)
but is there any way that i can use:

wb1.Document.InvokeScript("sendstickyto(); document.sendmail.submit(); return false;");

Or do i need to get that querystring you are talking about first ? :)
Hi
Check out below link.......

Control.Click Event
 
Share this answer
 
try this : an alert function

XML
<pre lang="HTML">
<a href="javascript:alert('here');" >an alert function</a>

</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900