Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web Form Fields
Message
De
02/10/2003 05:19:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00833976
Message ID:
00834141
Vues:
21
This message has been marked as the solution to the initial question of the thread.
>How can I enumerate thru web pages (Microsoft Web Browser Control) collecting the list of forms, fields & values? I can't use names since it can be any site. I see references to document.formname.fieldname.value, but I will not know the formname or fieldname at design time.
>
>I posted about an hour ago, but the message did not seem to show up; therefore, if this is a repeated question - I appologise.
>
>Troy

Troy,
You could use the collections like all, frames, forms, elements. ie:
lcVals = ""
If This.Object.Document.forms.Length > 0
  For Each oFrm In This.Object.Document.forms
    lcVals = lcVals + oFrm.Name + Chr(13)
    If oFrm.elements.Length > 0
      For Each oElem In oFrm.elements
        If oElem.Type = "select-multiple"
          lcList=''
          For ix=0 To oElem.Length-1
            If oElem.Item(ix).Selected
              lcList = lcList + Iif(Empty(lcList),'',',')+;
                       oElem.Item(ix).Value
            Endif
          Endfor
          lcVals = lcVals + "Name :" + oElem.Name + ;
                            "/Value:"+lcList + Chr(13)
        Else
          lcVals = lcVals + "Name :" + oElem.Name + ;
                            "/Value:"+oElem.Value + Chr(13)
        Endif
        oElem = .Null.
      Endfor
    Endif
    oFrm = .Null.
  Endfor
Endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform