FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to fire "Submit" button in Explorere ActiveX?
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
How to fire "Submit" button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 03:55 PM
Hello,

Please consider this sample:
#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oWnd, oActiveX

   DEFINE WINDOW oWnd

   @ 50, 10 ACTIVEX oActiveX OF oWnd ;
            SIZE 380, 170;
            PROGID "Shell.Explorer"

   @ 1,2 BUTTON "Fire 'Send' button" OF oWnd;
         SIZE 150,20;
         ACTION MsgInfo("Submit")

   ACTIVATE WINDOW oWnd;
     ON INIT oActiveX:Do("Navigate", "http://www.winfakt.be/form_test_1.htm" )

RETURN NIL

How can I let the BUTTON on the Window fire the "Send" button IN the ActiveX web page?

This is the source of form_test_1.htm is :
<html>
<body>
<form name="frm_test" action="form_test_2.asp" method="post">
       Text: <textarea name="f_text"></textarea><br />
       <input type="submit" name="f_submit" value="Send" />
</form>
</body

form_test_1.asp is :
form_test_2.asp
----------------------
<hrtml>
<body>
Test OK!<br /><br />
Input was: <%= request.form("f_text") %>
</body>
</html>


Patrick
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:00 PM

Patrick,

You can directly Navigate2 to form_test_2.asp. No need to go through the HTML page.

Unless you want to show it, for some reason ? Surely we can fire the submit button if you need it.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:09 PM
Antonio Linares wrote:You can directly Navigate2 to form_test_2.asp. No need to go through the HTML page.

Unless you want to show it, for some reason ? Surely we can fire the submit button if you need it.

Thanks for the hint, but if I do this, I don't receive the text input from the form in for_test_1.html

So I think we need to have something that fires the "Submit" button on the form. :-)

Patrick
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:33 PM

Patrick,

> I don't receive the text input from the form in for_test_1.html

You send that info from your EXE :-)

You show a dialog box and request the info from the user, then you send that info to the ASP.

Unless you want to do it from the HTML :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:35 PM
Antonio Linares wrote:> I don't receive the text input from the form in for_test_1.html

You send that info from your EXE :-)

You show a dialog box and request the info from the user, then you send that info to the ASP.

Unless you want to do it from the HTML :-)

The purpose of this sample is to show you that I want the button to be ON the dialog, and the input fields IN the HTML. :-)

Patrick
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:48 PM

Oh, ok. Then lets see how to fire the submit button :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:49 PM
Antonio Linares wrote:Oh, ok. Then lets see how to fire the submit button :-)

Thanks! :-)

Patrick
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:50 PM

document:submit() (?)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:51 PM

or:

document:formName:submit() (?)

I have not tested it. Just googled for it :-)

http://www.google.es/search?hl=esq=htm ... ent+submit

&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 04:56 PM
Antonio Linares wrote:or:

document:submit() (?)

I have not tested it. Just googled for it :-)

http://www.google.es/search?hl=es&q=htm ... ent+submit

Well, I did not find a Submit() method for the activeX.

How do you do "document:submit()" in the activeX?

oActiveX:Do("Submit") did not do the trick..

Patrick
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 05:03 PM

Patrick,

oActiveX:GetProp( "Document" ):Submit()

You have to review the Shell.Explorer docs ;-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 05:05 PM
Antonio Linares wrote:Patrick,

oActiveX:GetProp( "Document" ):Submit()

You have to review the Shell.Explorer docs :-)
Gives this error:
Error Shell.Explorer/0 S_OK: FRM_TEST

Patrick
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 05:07 PM
Antonio Linares wrote:or:

document:submit() (?)

I have not tested it. Just googled for it :-)

http://www.google.es/search?hl=es&q=htm ... ent+submit


The correct Javascript syntax is

document.formName.submit();


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 05:09 PM
Antonio Linares wrote:Patrick,

oActiveX:GetProp( "Document" ):Submit()

You have to review the Shell.Explorer docs :-)


It lacks of formName. Maybe something like

oDoc = oActiveX:GetProp( "Document" ):Submit()
oDoc:GetProp( "formName" ):Submit()

?

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to fire &quot;Submit&quot; button in Explorere ActiveX?
Posted: Wed Sep 10, 2008 05:21 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com