` Printed Icetips Article

Icetips Article



Clarion in general: Completing a webform from Clarion
2002-07-12 -- John Dunn
 
Newsgroups: comp.lang.clarion

>Is it possible to send information from a clarion app to a website to
>complete an online form on the webpage?
>If possible please give some info


Hi Anton,

Here is some code that I use to do this:

TrackPackage                ROUTINE

 WebBrowser              = CREATE(0,CREATE:OLE)
 WebBrowser{PROP:Create} = 'InternetExplorer.Application'
 WebBrowser{'Visible'}   = True
 UrlString  = 'http://www....'

 WebBrowser{'Navigate(' & CLIP(UrlString) & ')'}

! Waiting until page load

 StartTime = CLOCK()
 LOOP
   IF WebBrowser{'ReadyState'} = 4 THEN BREAK.
   IF CLOCK() - StartTime > 1000 THEN BREAK. ! 10 seconds
   YIELD()
 END ! loop

! Fill fields

 WebBrowser{'Document.forms("SearchForm").SearchField.Value'} = |
CLIP(Pkg:TrackingNo)

 WebBrowser{PROP:Deactivate}

 DESTROY(WebBrowser)

You will need to look at the HTML source for the target info.

HTH,

John



Printed November 21, 2024, 7:02 am
This article has been viewed/printed 35218 times.
Google search has resulted in 47 hits on this article since January 25, 2004.