Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.06.10;
Скачать: CL | DM;

Вниз

Вопрос о WebBrowser   Найти похожие ветки 

 
ppcumax ©   (2007-05-21 00:08) [0]

Как в WebBrowser, в открытой странице на ходу изменить значение полей? Например есть поле <input type="text" name="text" value="">, нужно чтоб программа автоматически подставляла мой текст в value. Спасибо


 
ppcumax ©   (2007-05-21 00:40) [1]

гг, уже разобрался

function FillForm(WebBrowser: TWebBrowser; FieldName: string; Value: string): Boolean;
 var
   i, j: Integer;
   FormItem: Variant;
 begin
   Result := False;
   //no form on document
 if WebBrowser.OleObject.Document.all.tags("FORM").Length = 0 then
   begin
     Exit;
   end;
   //count forms on document
 for I := 0 to WebBrowser.OleObject.Document.forms.Length - 1 do
   begin
     FormItem := WebBrowser.OleObject.Document.forms.Item(I);
     for j := 0 to FormItem.Length - 1 do
     begin
       try
         //when the fieldname is found, try to fill out
       if FormItem.Item(j).Name = FieldName then
         begin
           FormItem.Item(j).Value := Value;
           Result := True;
         end;
       except
         Exit;
       end;
     end;
   end;
 end;



Страницы: 1 вся ветка

Текущий архив: 2007.06.10;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.03 c
2-1179705309
dreamse
2007-05-21 03:55
2007.06.10
Подскажите ключ реестра


6-1164561105
ph0sgen
2006-11-26 20:11
2007.06.10
MX-запись


2-1179898767
panchi
2007-05-23 09:39
2007.06.10
как сохранить


15-1178905271
isasa
2007-05-11 21:41
2007.06.10
Так, все-таки, ктото юзает Turbo Delphi, а ля BDS


1-1176820057
DelphiLexx
2007-04-17 18:27
2007.06.10
DrawText