We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
Am looking for a way to add a "/" symbol between a value entered in to a text field ("text1"). The limit of characters is 7, and the "/" symbol should go after the first 3 figures, and again after the 5th figure, e.g. a user enters "19843T54", and ideally after should be "198/43/T54".
Possible with script?.
You said char limit is 7 and in your example you have 8 char "19843T54",
There is multiple ways to achive it, you can try use this as "Custom format script" of "text1" field:
var str = event.value.slice(0,3)+"/"+event.value.slice(3,5)+"/"+event.value.slice(5,8);
event.value = str;
What should happen when the user enters "198/43/T54" ?
Under the field's Properties dialog, in the Format tab, select Special, then Arbitrary Mask and enter the following:
That won't work if he set character limit.
Many thanks for the replies, and both Nesa's and Try67 answers both worked absolutely perfectly (despite the fact I obviously cannot count!). In the end, Try67's answer worked best for me, but both were great solutions to my original post...and of course Bernd's note is equally true, but I will remember to not mis-type seeing as it's me that will be filling it in ;-).
The character limit is not needed if you use an arbitrary mask. It limits the number of characters the user can enter automatically.
Thanks Try67, a great solution 😉