axWebBrowser and HTMLInputElement

  • Thread starter nsrajesh via DotNetMonster.com
  • Start date
N

nsrajesh via DotNetMonster.com

Hi
I need an immediate help from you guys. I am doing a project, that automate
the web browser control. It has to fill some text fields and click a submit
button.

I use the below code tho fill it and click.
********************************
HTMLDocument myDoc = new TMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;

HTMLInputElement otxtSearchBox = HTMLInputElement) myDoc.all.item("subject",
0);

otxtSearchBox.value= "intel corp ";

HTMLInputElement otxtSearchBox1 (HTMLInputElement) myDoc.all.item("mailbody",
0);

otxtSearchBox1.value = "Body";

HTMLInputElement btnSearch = HTMLInputElement) myDoc.all.item("-Send-",0);
btnSearch.click();

Here all the controls should have some name to perform this actions. But in a
html page the submit button hasn't have any name.
Here is my question : How can i click that button.

Please i need this problem to be solved as soon as possible.

Thank you guys.

Rajesh
 
A

Alex Koltun

Hi,

Does the form has a name or ID , if so you can just invoke the form's
submit method that will result in a for submission.

I hope it will solve your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top