
17.11.2009, 19:30
|
|
Участник форума
Регистрация: 04.06.2009
Сообщений: 176
Провел на форуме: 840493
Репутация:
0
|
|
Слушай Я сделал вот так, в принципе работает
Код:
procedure TForm1.btn2Click(Sender: TObject);
var
doc : IHTMLDocument2;
col : IHTMLElementCollection;
el : IHTMLElement;
i : integer;
begin
doc := wb1.Document as IHTMLDocument2;
col := doc.all.tags('textarea') as IHTMLElementCollection;
for i := 0 to col.length-1 do
begin
el := col.item(i, 0) as IHTMLElement;
el.setAttribute('value', 'Marsel', 0);
end;
end;
но почему то к типу file не подходит, делаю вот так:
Код:
procedure TForm1.btn2Click(Sender: TObject);
var
doc : IHTMLDocument2;
col : IHTMLElementCollection;
el : IHTMLElement;
i : integer;
begin
doc := wb1.Document as IHTMLDocument2;
col := doc.all.tags('input') as IHTMLElementCollection;
for i := 0 to col.length-1 do
begin
el := col.item(i, 0) as IHTMLElement;
if el.getAttribute('type', 0) = 'file' then
el.setAttribute('value', 'Marsel', 0);
end;
end;
но совсем не работает? Думаете почему?
|
|
|