I've tried but it's the same :-( It works well when the input type is text (<INPUT TYPE=TEXT>), but it didn't worked on file. I already find information about this file input type, and i've found some several web browser (including Internet Explorer, which TWebBrowser is an instance from it) implement some "special management" on this method for security reason (e.g for protection on automatic file uploading from local PC to a web server by using javascript).
--- ramazan aslan <[EMAIL PROTECTED]> wrote: > Hi, > > > > Try this; > > > > > > function TForm1.FillAField(fieldName : String; > fieldValue : String); > > var > > allfields : IHTMLElemenCollection; > > i : integer; > > o : Olevariant; > > oneelement : IHTMLElement; > > > > begin > > > > allfiles := webbrowser1.document.all.tag('file') as > IHTMLElementCollection; > > > > for i := 1 to allfields.length do begin > > o := i - 1; > > try > > > > oneelement : allfields.item(o,'') > IHTMLElement; > > if oneelement.getAttribute('name') = > fieldName then > > oneelement.setAttribute('value') := > fieldValue; > > except > > //Can't do anything > > end; > > end; > > end; > > > I hope this will help you... > Regards, > Ramazan > ------------------------ CoolKid K-Qha http://kha.orgfree.com ------------------------ ____________________________________________________________________________________ Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html