Hi all,
is there a way to set a textbox with automatic Uppercase, and placeholders for a typical IBAN number?
i.e. every 4 characters a spacer like "XXXX XXXX XXXX XXXX XXXX"
Form textbox with IBAN
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Form textbox with IBAN
Hello woody-soft,
Actually IBAN numbers differ from country to country, so while there are some common elements - the length of those is not uniform.
You can set up "Format Value" options for a text form field, and could have "custom action" with JS code executed to handle the formatting of your field, but I do not have any samples of how this is done exactly, and you will likely need regular expressions as part of the formatting and validation of the user input!
This page might have some examples on custom scripts you could put in these two places: Kind regards,
Stefan
Actually IBAN numbers differ from country to country, so while there are some common elements - the length of those is not uniform.
You can set up "Format Value" options for a text form field, and could have "custom action" with JS code executed to handle the formatting of your field, but I do not have any samples of how this is done exactly, and you will likely need regular expressions as part of the formatting and validation of the user input!
This page might have some examples on custom scripts you could put in these two places: Kind regards,
Stefan
-
- User
- Posts: 6
- Joined: Fri Oct 14, 2011 6:13 pm
Re: Form textbox with IBAN
Thanks Stefan. Actually, I'm not concerned about the length (we only need to enter the german 22 chars in that particular PDF) and validation, just about automatic UPPERcase and that "4 chars - 1 space" sequence for easy entering of those strings. Someone with JS knowledge here?
Wouldn't it be cool, if PDFX would have that "automatic Uppercase" as a predefined action? (Similar to that "only numbers" option)
wOOdy
Wouldn't it be cool, if PDFX would have that "automatic Uppercase" as a predefined action? (Similar to that "only numbers" option)
wOOdy
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Form textbox with IBAN
Hello woody-soft,
I spent some time digging deep into JS - and almost got it to work writing my own code, but when I got stuck and asked a colleague from the dev team for help - it turned out it can be done pretty easily with just a few lines of code and some built in functions. Please see attached a sample file with the field included - you can copy and paste that filed in other files as needed.
The code is located in the Format Value -> Keystroke Action -> Run a JS part of the field's settings and is this one:
The mask is two letters followed by 20 digits, and if you want to allow any character - you can use X (e.g. XXXX XXXX XXXX XXXX XXXX XX to allow any symbol in any of the 22 positions).
Kind regards,
Stefan
I spent some time digging deep into JS - and almost got it to work writing my own code, but when I got stuck and asked a colleague from the dev team for help - it turned out it can be done pretty easily with just a few lines of code and some built in functions. Please see attached a sample file with the field included - you can copy and paste that filed in other files as needed.
The code is located in the Format Value -> Keystroke Action -> Run a JS part of the field's settings and is this one:
Code: Select all
if (!event.willCommit) {
// Directly convert any lowercase letter input into uppercase as we type/paste
event.change = event.change.toUpperCase();
// format the value in the field as we type
mask = "AA99 9999 9999 9999 9999 99";
AFSpecial_KeystrokeEx(mask);
}
Kind regards,
Stefan
- Attachments
-
- German_Iban.pdf
- (4.96 KiB) Downloaded 35 times
-
- User
- Posts: 6
- Joined: Fri Oct 14, 2011 6:13 pm
Re: Form textbox with IBAN
Hey Stefan,
works perfectly, Thank you very much!
(And I even learnt a bit or two )
wOOdy
works perfectly, Thank you very much!
(And I even learnt a bit or two )
wOOdy
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Form textbox with IBAN
Hello woody-soft,
Glad to hear it works for you!
I also learned quite a few things while looking at this problem!
Kind regards,
Stefan
Glad to hear it works for you!
I also learned quite a few things while looking at this problem!
Kind regards,
Stefan
Re: Form textbox with IBAN
I needed something similar and this post helped me immensely
Thanks!
Thanks!
- Dimitar - Tracker Supp
- Site Admin
- Posts: 1797
- Joined: Mon Jan 15, 2018 9:01 am