Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refering to IE document form elements 1

Status
Not open for further replies.

chriss87

Programmer
Jan 29, 2007
11
PL
Hello

I have a little problem writing a script that fills web formular fields.

I'm using IE.application object, and I know how to refere to a from which doesn't have a name:

objIE.document.Forms(i)

it is easy to submit such a form, but sometimes it has a few fields like

<input type="text" (...)>

The problem is that form elements names are generated each time u enter that page, so writing a fixed name doesn't work...
Is there a possibility to refer to an <input ...> field without knowing its name (like refering to forms)?
 
[tt]for i=0 to objIE.document.forms.length-1
for j=0 to objIE.document.forms(i).elements.length-1
wscript.echo objIE.document.forms(i).elements(j).name & vbcrlf & objIE.document.forms(i).elements(j).value
next
next[/tt]
 
Awesome :-D

thx a lot - it's just what i needed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top