Copy link to clipboard
Copied
I have a form field in which a 4-digit number is entered, and:
1. Upon exiting the field would like the @ symbol to appear at the beginning of the 4-digit number: Type "1234" and diplay "@1234"
2. If the form field is blank (not used) then the @ symbol does not appear.
Try this as validation script:
event.value = event.value != "" ? "@"+event.value : "";
How are you changing numbers in field?
It will give you duplicate if when changing number manually you change only number and not @ .
As sugested by @JR Boulay move script to custom format script.
Copy link to clipboard
Copied
Try this as validation script:
event.value = event.value != "" ? "@"+event.value : "";
Copy link to clipboard
Copied
It would be best used as a "Format" script
😉
Copy link to clipboard
Copied
Thank you, that worked perfect!
Copy link to clipboard
Copied
When I enter:
event.value = event.value != "" ? "@"+event.value : "";
It works perfect, but each time I modify a number in the field it adds an additional @ symbol to the beginning (i.e. @理菜山58955789, @@2345, @@@3456, etc.). Other than deleting the displayed @ sybmol in the field each time I change the number, is there a way to stop extra @ symbols from repeating?
Copy link to clipboard
Copied
I'm not the brightest in Adobe, but I can remember that you can format it with a text field.
Steps for Adobe Pro DC
Prepare form,
go to text field,
Right mouse click,
Choose properties,
Options,
Enter standard value,
insert the character "@",
Conclude.
So it should appear every time you click on the field.
I am sure that there are more suggested solutions, but this is easy and quick.
I hope I could help you.
If that's not what you want, just ignore it.
Thx
Nikolaos.
Copy link to clipboard
Copied
When I enter:
event.value = event.value != "" ? "@"+event.value : "";
It works perfect, but each time I modify a number in the field it adds an additional @ symbol to the beginning (i.e. @1234, @@2345, @@@3456, etc.). Other than deleting the displayed @ sybmol in the field each time I change the number, is there a way to stop extra @ symbols from repeating?
Copy link to clipboard
Copied
Where does you use the script?
Copy link to clipboard
Copied
How are you changing numbers in field?
It will give you duplicate if when changing number manually you change only number and not @ .
As sugested by @JR Boulay move script to custom format script.