I have created a table, and am not really that experienced with tables, so I just need a little help with the syntax.
The table is dynamic - the user can add and remove rows, and this works just fine. My problems is this: the first row is filled with default values in all fields. When the user adds a row, the new row conatins the same default values (of course), but I don't want that, I want blank fields. So I need a way to reference the different fields in the last added row, so I can set their values to a blank state.
My table is built up something like this:
Trainingtable
- Row0 (which I use as header row)
- Row1 (which is the row that gets repeated)
- Date (textfield)
- Duration (textfield)
- Tasks (textfield)
- Responsible (textfield)
So it's the textfields I want to reach, how can I do that? I have managed to find the "length" of the current table:
var rowindex = Trainingtable.Row1.instanceManager.count;
but after that I'm kind of lost :-p
So I have two suggestions:
1. Make Row0 a different animal, static text or at least a different subform.
2. If there is some compeling reason that Row0 needs to be the same subform as the other rows then set the default values to blank. Then use the forms initialize event to ensure that Row0 has the values in it that you want.
To get to a specific instance of a subform you need to use the resolveNode() fucntion.
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