PDA

Click to See Complete Forum and Search --> : html objects question


reeset
Jul 5th, 2000, 03:35 PM
I'm hoping that someone smarter then I might be able to lend me a hand. I am writing a program that outputs an .hta application and a vbs script. The outputed file is used to make changes to an Access Database, and the vbscript is used to actually make those changes. Well, here is my problem.

Lets say in the .hta program, the form name is "form1", and the textboxes to be changed are "T1-50"

Now I need to perform an action on all of those T1-50 textboxes when the submit button is clicked. However, I can not figure out how to set this into a loop. For example, I have tried:



For x=0 to 50
If form1.T & x & .value="Update" then
do something
Else
do somethingelse
end if
Next



The error that I am getting is that the object or method does not exist, which makes sense. However, in regular vb, I can write this statement and it will work, but not in vbs. Right now, the solution to my problem is to just write out each individual action, but this could make the .vbs file incredibly bulky (I am working with tens of thousands of records). I know that it can be done in Javascript, but I really don't want to do it, so if you can help, I would appreciate it.

Zaf Khan
Jul 5th, 2000, 08:00 PM
Instead of naming your textboxes Text1, Text2, Text3 etc...
Use Arrays, so its Text1(0), Text1(1), Text1(2) etc...

Then change youtr code to handle arrays instead of the string name


For x = 0 to 50
If Form1.Text1(x).Value = "Update" Then
'do something here

Else
'do somethingelse here

End If
Next


DocZaf
{;->