Question
Softdel
IN
Last activity: 24 Feb 2017 4:53 EST
How to allow only alphabet in text input control
Hi
I was trying to restrict entry of everything other than alphabet for text input control. But i coundnot find any setting for this.
Do I need to write external validation for same?
I am using Pega version 7.1.9
Thanks
sanjeev ranjan
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
Hello Sanjeev,
Are you looking for on the fly validation ? I don't think this is directly supported. But you can try by using custom javascript to achieve the same. We are not sure of the performance impact though.
Or you may try using an edit input rule and remove the characters other than alphabets, similar to pxLettersAndNumbersOnly.
Best Regards,
Mounika
Pegasystems Inc.
IN
Hi Sanjeev,
You can use Edit validate rule to achieve the same. We have OOTB "AlphabeticValidation" edit validate rule which checks if the specified string contains all letters, accepts an input parameter of string type. Returns true if the specified string contains all letters.
Hope this helps.
Best Regards,
Mounika
Softdel
IN
Thanks for your reply.
But when i included this rule in validation sitll it allows me to enter numers in input control field.
I don't want to allow numeric entry in my field. If user enters anything other than alphabet then it should not accept that entry.
Thanks
Accepted Solution
Pegasystems Inc.
IN
Hello Sanjeev,
Are you looking for on the fly validation ? I don't think this is directly supported. But you can try by using custom javascript to achieve the same. We are not sure of the performance impact though.
Or you may try using an edit input rule and remove the characters other than alphabets, similar to pxLettersAndNumbersOnly.
Best Regards,
Mounika
Softdel
IN
Hi Mounika
Thanks for your reply. You understood me correctly.
I'll try with the javascript validation.
Regards
sanjeev
Pegasystems Inc.
IN
Hello Mounika,
Thanks for the response and suggestion. :)
I modified pxLettersAndNumbersOnly to use below Java Source:
theValue = pega_rulesengine_string.pxReplaceAllViaRegex(theValue, "/^[A-z]+$", "");
I do not see the restriction for numbers or other characters on the UI. However, while I run RegExpTester, it does not match numbers and other characters.
PS: My observation is from Pega 7.1.9.
Regards,
Rincy
EvonSys
IN
Hi Sanjeev
You can open that Property on which you want to apply this functionality.Then Follow the steps as below:-
Open Property-> Advance Tab-> In the Use Validate "Select AlphabeticValidation or AppCheckAlphabetic".
Save your changes and check.
-
Yahani Mohotti
Softdel
IN
Thanks for your reply.
But when i included this rule in validation sitll it allows me to enter numers in input control field.
I don't want to allow numeric entry in my field. If user enters anything other than alphabet then it should not accept that entry.
Thanks
Pegasystems Inc.
IN
Hello Sanjeev,
Thanks for posting your query in PSC :)
I used out of the box(OOTB) Edit Validate rule isLetter on property via Advanced tab's Use validate field. I see the output as below when user enters the texts(containing numeric digits and special characters) and clicks on the submit button.
I hope this answers the query raised.
PS: My observation is from Pega 7.1.9.
Regards,
Rincy