Skip to main content
Known Participant
July 11, 2023
Answered

Input number in first field, rest of fields on same page auto sequence

  • July 11, 2023
  • 1 reply
  • 492 views

On my form I have 8 input fields. I would like the user to input a number into the 1st field and have the rest of the fields auto populate the numbers consecutively. So if I put in "711231" in the first field, I'd like the 2nd field to auto fill "711232", the 3rd field to auto fill "711233", 4th to auto fill "711234", etc. I've searched and searched but I haven't found any javascript close enough to use. Any help is appreciated.

This topic has been closed for replies.
Correct answer Thom Parker

Use this Custom Validation Script in the WAYBILL_1 field

 

var nInc = event.value;
for(var i=2;i<9;i++)
	this.getField("WAYBILL_" + i).value = ++nInc;

 

 

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
July 12, 2023

Use this Custom Validation Script in the WAYBILL_1 field

 

var nInc = event.value;
for(var i=2;i<9;i++)
	this.getField("WAYBILL_" + i).value = ++nInc;

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
n2dzyneAuthor
Known Participant
July 12, 2023

That worked perfectly. Thank you so much!!