How to fire "Submit" button in Explorere ActiveX?

How to fire "Submit" button in Explorere ActiveX?

Postby Patrick Mast » Wed Sep 10, 2008 3:55 pm

Hello,

Please consider this sample:
Code: Select all  Expand view  RUN
#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 :
Code: Select all  Expand view  RUN
<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 :
Code: Select all  Expand view  RUN
form_test_2.asp
----------------------
<hrtml>
<body>
Test OK!<br /><br />
Input was: <%= request.form("f_text") %>
</body>
</html>


Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Wed Sep 10, 2008 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Patrick Mast » Wed Sep 10, 2008 4: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
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Wed Sep 10, 2008 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Patrick Mast » Wed Sep 10, 2008 4: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
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Wed Sep 10, 2008 4:48 pm

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Patrick Mast » Wed Sep 10, 2008 4:49 pm

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

Thanks! ;-)

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Wed Sep 10, 2008 4:50 pm

document:submit() (?)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Wed Sep 10, 2008 4:51 pm

or:

document:formName:submit() (?)

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

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Patrick Mast » Wed Sep 10, 2008 4:56 pm

Antonio Linares wrote:or:

document:formName: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:formName:submit()" in the activeX?

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

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Wed Sep 10, 2008 5:03 pm

Patrick,

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

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Patrick Mast » Wed Sep 10, 2008 5: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
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Enrico Maria Giordano » Wed Sep 10, 2008 5:07 pm

Antonio Linares wrote:or:

document:formName: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

Code: Select all  Expand view  RUN
document.formName.submit();


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Wed Sep 10, 2008 5: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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Sep 10, 2008 5:21 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests