I have searched high and low, and can't quite figure this out. Any help would be appreciated.
I have X number of text boxes on a page. It is always changing, but I do have the total number stored in a hidden text box titled 'loops'. The text boxes are named in the fashion of:
quant1
quant2
quant3
and so forth. I am trying to create a loop that will read the contents of each text box and check for a match with 'xyz'. Note: The following does not work, but is what I am trying to do:
<script language="JavaScript">
<!--
function check_form(f) {
for (i=1; i<document.daForm.loops.value; i++) {
if (document.daForm.quant' + i + '.value == 'xyz') {
alert('I wish the above would work');
}
}
}
-->
</script>
Andrew
I have X number of text boxes on a page. It is always changing, but I do have the total number stored in a hidden text box titled 'loops'. The text boxes are named in the fashion of:
quant1
quant2
quant3
and so forth. I am trying to create a loop that will read the contents of each text box and check for a match with 'xyz'. Note: The following does not work, but is what I am trying to do:
<script language="JavaScript">
<!--
function check_form(f) {
for (i=1; i<document.daForm.loops.value; i++) {
if (document.daForm.quant' + i + '.value == 'xyz') {
alert('I wish the above would work');
}
}
}
-->
</script>
Andrew