Autor Beitrag
susi_777
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 29.01.07 18:12 
Hallo,

ich habe hier im Forum eine unit gefunden, wie Felder, Buttons usw. in eine Stringliste eingelesen werden können.
Nun möchte ich aber, dass nicht alle Form-Elemente eingelesen werden.
Radio-, Checkbox-, File, hidden, submit konnte ich bereits über den type abfangen.


ausblenden Delphi-Quelltext
1:
2:
3:
if ((FormItem.Item(j).type <> 'hidden'AND (FormItem.Item(j).type <> 'submit'AND (FormItem.Item(j).type <> 'checkbox'AND (FormItem.Item(j).type <> 'radio'AND (FormItem.Item(j).type <> 'file')) then begin
        SL.Add(FormItem.Item(j).Name);
        end;


Wie kann ich es verhindern, das die Namen der Select-Auswahlfehler eingelesen werden?
Vielen Dank für Eure Hilfe und schönen Gruß
Susi
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 29.01.07 19:40 
Hallo,

probier es mal mit type <> 'select-one'oder type <> 'select-multiple'.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
susi_777 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Mo 29.01.07 21:28 
Hallo Lannes,

das funktioniert leider nicht, aber ich gehe jetzt den anderen Weg und definiere was ich alles brauche:

ausblenden Delphi-Quelltext
1:
if ((FormItem.Item(j).type = 'text'OR (FormItem.Item(j).type = 'textarea'OR (FormItem.Item(j).type = 'password')) then begin					


Interessieren würde es mich aber trotzdem, wie man den type "select" abfragt.
Wenn jemand die Antwort kennt, bitte posten.

Schönen Gruß
Susi
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 30.01.07 00:22 
Hallo,
user profile iconsusi_777 hat folgendes geschrieben:
Hallo Lannes,

das funktioniert leider nicht...
also weg damit :roll:
user profile iconsusi_777 hat folgendes geschrieben:

Interessieren würde es mich aber trotzdem, wie man den type "select" abfragt.
mit der Abfrage auf 'select-one' :wink:

Beispielsweise:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
WebBrowser1.Navigate('http://www.delphi-forum.de');
//...
procedure TForm1.BtnClick(Sender: TObject);
var i,j,k : Integer;
    FormItem : OleVariant;
begin
  for i:=0 to WebBrowser1.OleObject.Document.forms.Length -1 do
    begin
    FormItem := WebBrowser1.OleObject.Document.forms.Item(i);
    for j:= 0 to FormItem.Length-1 do
      if FormItem.Item(j).type = 'select-one' then
        for k := 0 to FormItem.Item(j).Options.Length-1 do
           Memo1.Lines.Add(FormItem.Item(j).Options.Item(k).Text
                           + ' = <'
                           +FormItem.Item(j).Options.Item(k).Value
                           +'>');
      end;
    end;
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
susi_777 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Di 30.01.07 00:37 
Vielen Dank, Dein Code funktioniert einwandfrei - das kann ich bestimmt noch gebrauchen :D

MfG
Susi