
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 06:55 AM
I have a field on a catalog form. The field is requesting the last four digits of the SSN # or Personal ID #. Today the field is setup as a single line text field, but I want to do the following:
a) make the field size = 4
b) I only want to allow that field to have numeric characters
I want to ensure that when I shorten the field size that I am only shortening it for this variable.
Thanks,
Karen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 07:50 AM
My apologies. Try changing it to /^[0-9][0-9][0-9][0-9]$/ inside the quotes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 07:50 AM
My apologies. Try changing it to /^[0-9][0-9][0-9][0-9]$/ inside the quotes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 06:03 AM
Thank you so much, after I changed it - it works perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 08:00 AM
Hi Karen,
As to regex this should do: "^[0-9]{1,4}$"
By the way when you want to test your regexes try this website: Online regex tester and debugger: JavaScript, Python, PHP, and PCR
It also nicely explains what rules are applied on the right hand side.
Cheers
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 08:50 AM
Greg, that won't require all four numbers to be provided. I believe that the PIN and SSN will always be 4 characters, which is why I gave her the expression I did.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 11:24 AM
Hi Joshua,
Ahh, yes you're right. We can shorten it to this then: "^\d{4}$" which is basically your response.
Cheers
Greg