
- 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-19-2015 07:15 AM
I think you would need to run an onchange client script on the field to make sure that there are not more than 4 digits and they're all numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2015 11:33 AM
Two things to do:
1. In the attributes field of the variable, add max_length=4
2. Create an onChange client script for the field with the following code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var check = new RegExp('\d\d\d\d');
if(!check.test(newValue)){
alert('Please enter a valid PIN or Last Four'); //The wording can be modified, of course.
control.value = oldValue;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 06:12 AM
Joshua I wanted to say thank I haven't tried this yet but when i do I will mark it correct answer or helpful. I will not forget.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2015 06:58 AM