mfc >> HTML "submit" without Browser

by Julia Weber » Fri, 23 Apr 2004 19:41:42 GMT

Hi!
I need to submit an HTML form programmatically but I don't
want to use an HTTP POST. Instead I would like to simulate
a "hidden" button click on "submit" ("click" without using
a browser window).
Here is what I want in pseudo-code:

HTMLDocument doc
doc.LoadURL(url)

HTMLInputElement login = doc.GetInputItem("username")
login.value = "loginname"

HTMLInputElement passwd = doc.GetInputItem("password")
passwd.value = "password"

HTMLInputElement submit = doc.GetInputItem("submit")
submit.click()

Can anyone provide me some easy-to-understand code
snipplet? I checked several examples like the MSDN
WalkAll, but I didn't understand it => too complicated for
me :-(.

mfc >> HTML "submit" without Browser

by Ajay Kalra » Sun, 25 Apr 2004 06:29:28 GMT


I have done this successfully using IWebBrowser2's object model. I found the
book by Scott Roberts(for IE5) to be very helpful. Its been a while since I
did this but you have the right idea. You need to do this when the document
is completely loaded. Search Codeguru for samples as well or if you can get
hold of the Scott's book's samples, that will be helpful.

mfc >> HTML "submit" without Browser

by Julia Weber » Mon, 26 Apr 2004 16:19:14 GMT

Thanks Ajay! I found a code example in Codeguru, which was
very helpful and also understandable!
For everybody who have the same problem, take a look at
the "Creating an Internet Explorer Helper Class" article:

http://www.codeguru.com/Cpp/I-
N/internet/browsercontrol/article.php/c6175/


model. I found the
been a while since I
when the document
or if you can get
in message

don't
simulate
using
for

Similar Threads

1. how to get pure html without javascript from ms web browser control

2. problem of html form auto submit

htmlelement btn=...;
btn.invokemember("click");

if <form> no name,no function and submit button no function,it's the only 
way to submit? the "click" is useful. it comes where?

3. Submit a HTML Form programmatically - CSharp/C#

4. Submitting params from HTML to activeX control

Hi,


I have an activeX control (programmed with c++) which is displayed in
the Internet Explorer via the object tag. Now, as you probably know,
you can pass parameters to the activeX control by using the param tag.
My question now is, how do I get these parameters into my activeX
control.
I have several "DISP_PROPERTY_EX_ID" in my control which I want to fill
via the param tag. Do I have to make my control safe for scripting or
do I have to implement a special interface to set the parameters?

Does anyone know how to realize that? Can anyone help me?


Thx in advance, 


Kai I. H.

5. Embedded HTML Control Not Submitting Forms - Windows CE

6. Submitting HTML parameters to activeX control

Hi,

I have an activeX control (programmed with c++) which is displayed in
the Internet Explorer via the object tag. Now, as you probably know,
you can pass parameters to the activeX control by using the param tag.
My question now is, how do I get these parameters into my activeX
control.
I found hints about using IPropertyBag, but didn't find a good example
on how to implement that. I even don't know whether this is the right
way to get the parameters.

Does anyone know how to realize that? Can anyone help me?

Thx in advance,

Kai I. H.

7. How to Submit a webpage without refreshing it? - CSharp/C#

8. IP 2007 C# submit doesn't really submit

I know I must be missing some setting.  I'm submitting to a SharePoint 
library.  This works great when I choose "send form to a single desination" 
in submit options and choose the SharePoint destination.  However when I 
choose perform action using custom code implementing FormEvents_Submit (and 
set e.CancelableArgs.Cancel = false;) it tells me that it submitted but I 
don't see the file transfer to SharePoint as I do with the other option set, 
nor do I see the form shwo up in SharePoint. 

When I implement my own submit button and call this.Submit(), sometimes I 
also get no exception.

Perhaps I need to set the file name?  If so where the heck is that in the 
object model?

Help appreciated.