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

Generating sequential numbered fields for labels

New Here ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

Novice user here ..

I can't seem to find exactly what I am looking for through other discussions.

I'd like to create a sequential number layout that will auto-fill through multiple pages (if necessary).

I;d like the Item# to automatically populate throughout the document in sequential order which will match an exteral log.

I've tried javascript and headers and footers, but I'm not getting exactly what I need it to do.

Ashley250449787imy_0-1681236624101.png

Thank you in advance 🙂

 

TOPICS
Create PDFs , How to , JavaScript , PDF forms

Views

2.3K

Translate

Translate

Report

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
Enthusiast ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

You need to provide some more info.

Where do you get number from, what does trigger number input?

What exactly did you try, photo doesn't tell us much?

Votes

Translate

Translate

Report

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
New Here ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

I am trying to figure out how to articulate this without being overly confusing.

I do not know what the best way is to input the number to have the sequence start. I started to prepare a form from an online label template.

I created text fields next to the Item # and would like for them to start at 1 in the upper left corner and continue in sequence to the end of the document and have that continue to multiple pages (if necessary). We may not always need multiple pages of these labels.

So, basically I need the first page of Item #s to go from 1-30. Page 2 would be 31+ and so on.

I found a thread using javascript, but I do not fully understand how to apply the javascript to fields to have it work properly. I also don't know that this script applies to exactly what I need it to do.

Another user wanted pages to save in sequence after the master form was closed.

var num = this.getField("ItemNumber");num.value = Number(num.value)+1;num.defaultValue = num.value;

 

I know how to copy and paste text fields to have the data populate in multiple areas at once. I'd like to be able to follow the same process but have the numbering system add 1 counting up in each Item # field.

Votes

Translate

Translate

Report

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
Enthusiast ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

You want to populate all fields at once or one by one with a button click or something else?

Votes

Translate

Translate

Report

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
New Here ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

I'd like all the fields to populate at once, if possible. Sounds efficient, since the Item#s won't change out of sequential order.

If I enter number 1 on the first label in the upper left corner, I'd like 2-30 to auto-fill in the rest of the document.

If I enter 2 on the first label in the upper left corner, I'd like 3-30 to auto-fill in the rest of the document.

 

I'd also like to be able to create more pages in the event we need to print more than 30 labels at once.

I'll have the other fields auto-fill because that information will remain the same per event. The fillable fields will change based on the event, but the Item #s won't change.

I was messing with headers/footers as well, but again, novice user and didn't fully understand how to apply them properly.

Votes

Translate

Translate

Report

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 ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

If your fields are named like this, "ItemNumber.1","ItemNumber.2","ItemNumber.3"...etc you can use this for example in a button and it will populate all fields:

var fields = this.getField("ItemNumber").getArray();
for(var i in fields){
if(fields[i].valueAsString == "")
fields[i].value = fields[i].name.split(".")[1];}

Votes

Translate

Translate

Report

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
New Here ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

Thank you! I think I tried this with the original javascript I found in another thread, but the command wasn't exactly what I needed.

Can you clarify what you mean by "in a button" and it will populate in all fields? Do I set the javascript command and it will automatically apply to the fields? Do I put the array of fields in "getArray" for the range?

I have no idea how to apply javascript other than following your instructions.

Votes

Translate

Translate

Report

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 ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

"In a button" it means you place script in Button field under 'Actions' tab as 'Mouse UP' and select 'Run a JavaScript' and paste script there.

So when you click on a button it will populate all fields with name "ItemNumber", that why is important to name fields correctly as "ItemNumber.1" it will split field name at dot and use number to place it as field value.

Even when you add more fields, if you click on the button again it will populate them too.

Votes

Translate

Translate

Report

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
New Here ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

That worked!!!! Thank you!!!

One more question - can I duplicate this page easily in the event I need more pages of labels to print? Would I need to go into the text boxes on the next page and update the text boxes to "ItemNumber.31" etc to have it continue after the first page of 30 item numbers?

Votes

Translate

Translate

Report

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
New Here ,
May 13, 2024 May 13, 2024

Copy link to clipboard

Copied

LATEST

How do i do this that i can create a sequence as i go instead of all at once? for exmple if i have a form with 20 rows under item number but in this particular case i only have 10 items. I would only want my numbers to go up to 10 and not 20. 

Votes

Translate

Translate

Report

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