- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â03-28-2019 02:56 PM
Hey snow folks,
I have a single line text catalog variable called 'Alert Frequency' and I want to force the users to enter a specific format in it.
I made the max length of it to 12 and I want it in the format of 30,15,7,5,1 (something like this) with only numbers and commas.
I am able to restrict it to enter only numbers and commas but user can enter something like 123123 which doesn't make sense.
I need something like number,number,number..... as shown below
Any thoughts?
Thanks in advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â03-28-2019 03:28 PM
Hello ,
So after digging a bit and modifying some of the regex patterns, I found a solution for you. basically you can copy paste this entire code in your catalog client script for that catalog variable:
This will check various edge cases like no alphabets, no comma at the end , no comma in the beginning, only numbers etc etc.
Happy coding. Make sure that you change the variable names accordingly and you are good to go !
Please mark this answer as correct if this helps to solve your problem.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â03-28-2019 07:24 PM