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?
Copy link to clipboard
Copied
Use a separate field for each number.
Copy link to clipboard
Copied
Can I do it in one field so that don't need to tab to next field
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.
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.
Copy link to clipboard
Copied
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.