Add / Auto populate dash after 3 characters / Have pre-defined Text box with dash at 4th

Hi All,

How do I,

- Add during run-time a dash after 3 characters entered on a input text box

- Or have a pre-defined text box with hyphen already placed at 4th position

- Or any other way for user to visualize dash at 4th position instead of him manually entering

Please suggest all the steps if possible, since I am new to Pega

***Edited by Moderator Marissa to update platform capability tags****


Keep up to date on this post and subscribe to comments

February 25, 2019 - 9:02am

You can create an Edit Input rule and specify it on the Advanced tab of the Property rule. In your section, you will need to add an On Change to post the value so it will show up right away; otherwise, it will not appear until the submit.

There is an OOTB appendDash Edit Input rule. It would put the dash at the end, not where you want it, but you could check it out for your initial test to see if this would work for you before you create your own.

March 11, 2019 - 1:13pm

Thanks CarissaW_GCS for your response.

I am new to Pega, do you have in detail steps or links to related topic to create this validation.

Thanks again.

August 12, 2019 - 1:08am
Response to rubygogri


While creating a property, you can go to the advanced tab and check the various fields to provide different validation rules. The edit input rule basically involves writing a piece of Java code, and does not require Pega knowledge.

To know how to create them in detail, go through the System Architect Essentials course on Pega Academy.

August 11, 2019 - 10:27am

can you please suggest how to insert hyphen in 9 digit zipcode(xxxxx-xxxx) using edit input rule


August 12, 2019 - 12:56am
Response to MadhulathaD


Edit input rule constitutes a simple java code. This does not require Pega knowledge.