Looping is pretty simple and the least of your worries since unfortunately, disabling form controls isn't really a feature in Acrobat forms, LiveCycle or AcroForm. The closest native feature to a traditional disable is setting the controls to "ReadOnly", which doesn't provide much in the way of visual cues for the user.
Fortunately there is a way to do a good looking disable (i.e. graying out), and you'll find the code for it here:
This code isn't too bad and it will make the presentation of your form much nicer than simply setting the fields to ReadOnly.
Thom Parker The source for PDF Scripting Info [url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often [url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat [url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url] [url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Fortunately there is a way to do a good looking disable (i.e. graying out), and you'll find the code for it here:
http://www.acrobatusers.com/tutorials/2007/09/js_disabling_fields
Copy and paste the function definitions presented here into a document script and then all you need to do is write a simple loop.
This code isn't too bad and it will make the presentation of your form much nicer than simply setting the fields to ReadOnly.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script