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

Number comb with suit position

Community Beginner ,
Dec 11, 2022 Dec 11, 2022

Copy link to clipboard

Copied

I want to do a text field with number comb, but between the number there is some hyphens "-" (like the credit card number, 0123-4567-8901-2345), but the number is not suit with the underline ( shown on the photo)

 

How to suit the position?

TOPICS
Edit and convert PDFs , How to , JavaScript , PDF forms

Views

1.1K

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 ,
Dec 11, 2022 Dec 11, 2022

Copy link to clipboard

Copied

Use a separate field for each number.

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 Beginner ,
Dec 11, 2022 Dec 11, 2022

Copy link to clipboard

Copied

Can I do it in one field so that don't need to tab to next 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
Community Expert ,
Dec 12, 2022 Dec 12, 2022

Copy link to clipboard

Copied

No, because you probably won't be able to align numbers to underline properly.

If you use a separate field for each number you don't need to use tab you can do it with a script, it will automatically go to the next field when you input a number.

Let's say you have fields named "Field1", "Field2", "Field3", "Field4"...etc.

Go to field properties and select 'Format' tab and under 'Custom keystroke script' use like this:

In "Field1" use this:

if(AFMergeChange(event).length == 1) this.getField("Field2").setFocus();

In "Field2" use this:

if(AFMergeChange(event).length == 1) this.getField("Field3").setFocus();

In "Field3" use this:

if(AFMergeChange(event).length == 1) this.getField("Field4").setFocus();

...etc. for the rest of the fields.

When you enter script, it will disappear, but it will still work.

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 ,
Dec 12, 2022 Dec 12, 2022

Copy link to clipboard

Copied

You have to select the font size and place the field very carefully for it to match perfectly. There's not much we can do about it for you, unless you share the actual file.

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 ,
Jan 18, 2023 Jan 18, 2023

Copy link to clipboard

Copied

LATEST

Given that layout, the only option you have is to create 4 separate fields. If you could replace the underlying comb layout with a comb that can include the dashes as part of the data entry, then you can use a single field with JavaScript that would add the dash for every 4 characters typed.

 

Let me know if either of these options are acceptable and I can help with the code.

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