Hoping someone can help me out... I have a SQL Server table with three fields: PartNum, Qty, and Increment. The first two fields are obvious, but the third (Increment) signifies that this part must be ordered in multiples of (Increment). So:
PartNum: 12345, Qty: 30, Increment: 50
PartNum: 23456, Qty: 100, Increment: 100
PartNum: 34567, Qty: 10, Increment: 0
The first record should fail a data validation check, as that part needs to be ordered in increments of 50. Records 2 & 3 are fine (Increment of 0 means no requirement).
The problem I have is I dynamically create form elements (text boxes) for my Qty and Increment (Qty is visible, Increment is hidden). The Qty text boxes are created in a <CFLOOP> tag and are named "Qty1", "Qty2", etc. The same is true with my "Increment1" hidden text boxes. I populate the value of the Increments with the appropriate value from my table, but I don't know how to perform the dynamic data validation using Javascript. Here's my form elements:
<input name="qty#currentrow#" type="text" class="font003" value="0" size="3" onChange="myTest(this)">
<input name="increment#currentrow#" type="hidden" value="#increments#">
The problem I have is: Rather than passing "this" (the Qty text box), how can I pass the appropriate Qty field and it's corresponding Increment field? Or how can I pass the entire form and pick out just the fields I need?
I'm a bit lost, obviously...
Thanks very much to anyone who can help...
Thanks!
Steve
PartNum: 12345, Qty: 30, Increment: 50
PartNum: 23456, Qty: 100, Increment: 100
PartNum: 34567, Qty: 10, Increment: 0
The first record should fail a data validation check, as that part needs to be ordered in increments of 50. Records 2 & 3 are fine (Increment of 0 means no requirement).
The problem I have is I dynamically create form elements (text boxes) for my Qty and Increment (Qty is visible, Increment is hidden). The Qty text boxes are created in a <CFLOOP> tag and are named "Qty1", "Qty2", etc. The same is true with my "Increment1" hidden text boxes. I populate the value of the Increments with the appropriate value from my table, but I don't know how to perform the dynamic data validation using Javascript. Here's my form elements:
<input name="qty#currentrow#" type="text" class="font003" value="0" size="3" onChange="myTest(this)">
<input name="increment#currentrow#" type="hidden" value="#increments#">
The problem I have is: Rather than passing "this" (the Qty text box), how can I pass the appropriate Qty field and it's corresponding Increment field? Or how can I pass the entire form and pick out just the fields I need?
I'm a bit lost, obviously...
Thanks!
Steve