Skip to main content
Participant
October 16, 2019
Question

Auto Sequential Numbering Script or Help?

  • October 16, 2019
  • 2 replies
  • 359 views

Hello,

New to acrobat and to javascripts.

I am attempting to have my photo log auto populate in sequential order.

Lets say I have photo 1450 and I input that into the first field I would like it to auto populate all the way down. What is the best way to accomplish this? any help would greatly be appreciated.

Also, I dont have a lot of experieance to if you decide to help with coding, please post the full code or explanation on how to input it. Thanks again

    This topic has been closed for replies.

    2 replies

    try67
    Community Expert
    Community Expert
    October 16, 2019

    Use this code as the custom Validation script of the first Photo Number field:

     

    for (var i=2; i<=15; i++) {
    	this.getField("PHOTO NUMBERRow"+i).value = (event.value=="") ? "" : (Number(event.value)+(i-1));
    }
    try67
    Community Expert
    Community Expert
    October 16, 2019

    Should it overwrite existing values in the other fields? Should you be able to overwrite the populated values manually, if you wanted to? Should it work from each field to the subsequent ones, or just the first one?

    Participant
    October 16, 2019

    It shouldn’t overwrite existing values because I plan on having it blank, fill in the starting photo number and hope to auto populate based off my input. I think overwriting if you wanted to would be a good option if possible. And I think just filling in the first one should be fine! It's a time saving effort and if it's something unique I can handle the extra time. Thanks again for the help!