These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Add Type A, B, C when new row is added.

CPearson
Registered: May 20 2008
Posts: 16
Answered

I have a Script to add a new row to my form:

form1.Subform0.Footer.Button1::click - (JavaScript, client)
// Add new Order line to end of list
_ItemDetail.addInstance();

I would like to have a box that as I add the new row ltters for that line will be added such as, Row A, next row B next row C and so on. THe letter for that row will remain as I delete the rows between. In other words if I delete row J, the following row which was K will remain K.

Thanks for your help with this.

Chris

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are several different ways you could approach this problem depending on the exact behavior you want. For a continous increment save the count in a hidden field. Then to get the character, just add the count to the character code for 'A', at the same time you create the new instance.

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