Is it feasible to write code that loops through a table in a form? I'm currently writing separate sections of code for each row of a five-row table to validate data entries.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
It would be easier if your table contained one row that repeated with an initial count of five (this is set in the binding tab of the Object palette). This will change the XML generated but assuming that is not a problem your could loop though your table with the code;
var rows = this.resolveNodes("Table1.Row1[*]");
for (var i=0; i<rows.length; i++)
{
var currentRow = rows.item(i);
.
.
.
}
If you do need the rows uniquely named then you could pass i and the result of "this.resolveNodes("Table1.Row"+i)" into a function.
This is you form back ... with only the first validation converted to the new approach.
https://acrobat.com/#d=akb0*Ptvdr3KSYN0VP*7zA
Hope this gets you started.
Regards
Bruce
Views
Replies
Total Likes
It actually depends on scenario....you need to post more details about your request and if possible share the form.....most codes segments are base on hierarchy and actions you would like to perform.
Views
Replies
Total Likes
Here's the form.
https://acrobat.com/#d=tc-tH46jIH8xx7i6pT60Rw
I was having issues with links earlier.
The validation occurs in the click event of btnSubmit.
Views
Replies
Total Likes
Hi,
It would be easier if your table contained one row that repeated with an initial count of five (this is set in the binding tab of the Object palette). This will change the XML generated but assuming that is not a problem your could loop though your table with the code;
var rows = this.resolveNodes("Table1.Row1[*]");
for (var i=0; i<rows.length; i++)
{
var currentRow = rows.item(i);
.
.
.
}
If you do need the rows uniquely named then you could pass i and the result of "this.resolveNodes("Table1.Row"+i)" into a function.
This is you form back ... with only the first validation converted to the new approach.
https://acrobat.com/#d=akb0*Ptvdr3KSYN0VP*7zA
Hope this gets you started.
Regards
Bruce
Views
Replies
Total Likes
That works for me. Thanks.
Views
Replies
Total Likes
Views
Likes
Replies