473,946 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mshtml HTMLFormElement events

Hi all,
dev. env.: VS.Net2003/C#

I have a windows form application with web browser control. I need to
capture the onsubmit event of the forms in the document in order to get
the values and log them.

I have tried this:

1.

this.current_pa ge = this.mydoc.Docu ment as mshtml.HTMLDocu mentClass;

if (this.current_p age != null)
{
mshtml.IHTMLEle mentCollection _forms = this.current_pa ge.forms;

foreach (mshtml.IHTMLFo rmElement _form in _forms)
{
((mshtml.HTMLFo rmElementEvents 2_Event)_form). onsubmit +=
new mshtml.HTMLForm ElementEvents2_ onsubmitEventHa ndler
(MyDoc_onsubmit );
}
}

2.
<same, just diff. foreach>
foreach (mshtml.HTMLFor mElementClass _form in this.forms)
{
_form.HTMLFormE lementEvents2_E vent_onsubmit +=
new mshtml.HTMLForm ElementEvents2_ onsubmitEventHa ndler
(MyDoc_onsubmit );
.....

And there are 2 articles on codeproject.com , they do not work also.

And ... no success. There is no exceprions, everything passes, but after
that the form submition on the page is blocked, even the submit button
does not work.

I have tried to go around this and to use BeforeNavigate2 event of the
browser (it works) and to examine if there is postdata. But in that case
I'll loose forms which has GET method.

Please, any help will be highly appreciated.

Thanks
Sunny
Nov 15 '05
10 8043
Hi Ariel,

I am working on a project that needs to capture the onsubmit event of a
form, and was wondering if there was any resolution to the problems
listed in this discussion. Thanks much.

Chris Mueller

Nov 16 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4682
by: Robert May | last post by:
I have an application that uses the Ax web browser object. When I call the IHTMLElement.click() method on an input button (<input type="submit"> or <input type="button">), the click fires appropriately, if I'm running it from a windows forms based application. However, when I run the EXACT same code under a windows service, either as a logged in user or as the local system account, the click fails to process. Clicking on other elements...
1
7798
by: Dean Hallman | last post by:
I need to ensure client machine has Microsoft.mshtml installed in the GAC. And if not, deploy it. My app is a Browser Helper Object and depends on mshtml. Initially, I thought I could take care of deploying mshtml within my install ..msi (VS.NET setup/deploy project). But if I simply add mshtml to the GAC from my install, the install fails near the end with the error:
0
1938
by: Giuseppe | last post by:
Hi I've this problem Inside a winform application I've put a "webbrowser" control I've tried to catch the oncontextmenu event of the loaded HTML document with the following approach 1) In the event handler AxWebBrowser1.DocumentComplete I've put: Dim doc As mshtml.HTMLDocument
3
5082
by: ddd | last post by:
I am trying to use MSHTML without the webbrowser and I am having a few problems. Right now all I am trying to do is load an URL(html page) and access its innerhtml. What I have is: Dim doc As mshtml.HTMLDocument = New mshtml.HTMLDocument() Dim d1 As mshtml.IHTMLDocument4 = doc Dim d2 As mshtml.IHTMLDocument4 = doc d2.write("<html><body>test</body></html>")
5
10933
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be appreciated. Thanks. Atara. ------------------------- Original code:
0
2247
by: Atara | last post by:
Our application was build with VS 2003. I have tried to run it on a computer with .Net 2.0 (but without .Net 1.1 , as it should be used) and I got the following error - System.InvalidCastException: Unable to cast COM object of type 'mshtml.HTMLBodyClass' to class type ''. COM components that enter the CLR and do not support IProvideClassInfo or that do not have any interop assembly registered will be wrapped in the __ComObject type....
5
4390
by: miktro | last post by:
I have an VB.Net desktop application where I am hosting a WebBrowser. I need to interact with the events in the browser. I encountered the normal problem of, after adding events the normal click on the browser didn't work (in particular you can't enter text into textareas). I found the Microsoft KB article 311284 - "How to handle document evetns in VB.Net" - and implemented the code.
0
1558
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100% on my machine, with the WebBrowser Class, and the Microsoft.MsHtml component. I can access all elements on the pages through the events, I can change some parts. Everything is rendered with XSLTs and changing directly the document through the msHtml...
0
1890
by: nickin4u | last post by:
I have a application that is used to automate certain task, I have been using mshtml.HTMLDocument class but certain events like click a button do not fire. I have tried a number of combinations but in vain. I was now trying to use System.Windows.Forms.Htmldocument class; here is the code Dim do1 As System.Windows.Forms.HtmlDocument = web1.Document web1 is axwebbrowser however when i execute the above line i get the error cannot...
0
11556
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11150
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10685
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9882
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8245
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4933
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3533
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.