Skip to main content
Participating Frequently
September 19, 2016
Answered

Auto-advance Numbers in a Form

  • September 19, 2016
  • 1 reply
  • 1295 views

I have a form where I created 12 different text fields.

I would like to enter a number in the the first field and have each of the subsequent fields auto-advance by 1.  So, for example, if the first number is 61, the last number should be 72.

Thanks for your inputs.

This topic has been closed for replies.
Correct answer George_Johnson

Yay!  Almost there!  The fields changed this time.  But one small issue.  It skips what should be the 2nd number in the sequence.


Change:

nStart + i

to:

nStart + i - 1

1 reply

Inspiring
September 20, 2016

What are the field names? You can use a custom validate script for the first field that gets the entered value and sets the other field values, but the script will depend on the names of the 11 subsequent fields.

Participating Frequently
September 20, 2016

I have them numbered "EXHIBIT NO#0" THROUGH "EXHIBIT NO#11". I can re-name them, of course.

Inspiring
September 21, 2016


Since your field names are now "EXHIBIT NO_1" through "EXHIBIT NO_12", change that one line of code to:

    for (var i = 2; i <= 12; i += 1) {