obige Funktion ungetestet abgeändert:
Delphi-Quellcode:
function WB_GetFieldValue(WB: TWebbrowser; FieldName: string): string;
var
IDoc3: IHTMLDocument3;
Inputs: IHTMLElementCollection;
UID: IHTMLElement;
begin
Result := '';
if Assigned(WB.Document) and
(Succeeded(WB.Document.QueryInterface(IHTMLDocument3, IDoc3))) then
begin
Inputs := IDoc3.getElementsByName(FieldName);
if Assigned(Inputs) then
begin
UID := Inputs.item(0, '') as IHTMLElement;
if Assigned(UID) then
Result := (UID as IHTMLInputElement).value;
end;
end;
end;