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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form iteration

Status
Not open for further replies.

TazzMann

Programmer
Jul 25, 2001
79
US
I have about 13 textboxes that have the same name except each one ends in a unique number (i.e. txtPrice1, txtPrice2, etc.)

On the OnSubmit Event, I want to be able to Iterate through each of these and verify that there is something in them, and if so, submit the values to a dll for processing.

Do until x = intCount 'intCount is a serverside variable x is client side

I have Tried the following with no success:

If frmMain.txtPrice(x).value=""
If frmMain.txtPricex.value = ""
If frmMain.txtPrice & x.value=""
If frmMain.txtPrice +x.value = ""
loop

Anyone know of a better way to do this in VBSCRIPT? Tazzmann
 
eg:

<form name=test115141>
<input type=text name=fVeld1>
<input type=text name=fVeld2>
<input type=text name=fVeld3>
<input type=button value=Press onClick=&quot;ShowThemAll();&quot;>
</form>

<script language=Vbscript>
function ShowThemAll
for i = 1 to 3
msgbox( eval( &quot;test115141.fVeld&quot; & i & &quot;.value&quot; ) )
next
end function
</script>
br
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top