Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

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

Community Beginner ,
Jul 11, 2023 Jul 11, 2023

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.

TOPICS
JavaScript , PDF , PDF forms
554
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jul 11, 2023 Jul 11, 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2023 Jul 11, 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 12, 2023 Jul 12, 2023
LATEST

That worked perfectly. Thank you so much!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines