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

The other fields (Case No., Plaintiff and Defendant) I actually do want to be all the same.

I corrected/renamed the Exhibit field.  Also, I looked at the coding script and made a couple changes that seemed appropriate, but it still did not populate correctly.


Make sure that the only the initial EXHIBIT field has a validation script. Then display the interactive JavaScript console by pressing Ctrl + J and change the value of the initial field. Are there any error messages in the console?