I’m new to this json stuff and do not quite understand how to do this part of the form.
We have had people enter either not enough numbers, letters, special characters or dashes.
I’ve tried searching on here and even googled it but I feel like our forms are very specific and could not find anything that seemed even close.
Here is what I have tried and when I open the page after building it only gives me the first line. Everything else is cut off so I cannot test to see if this part is even correct.
Any suggestions would be really helpful:
{
"key": "SocialSecurity",
"type": "input-uppercase",
"className": "col-sm-12 col-md-3 mt-auto",
"templateOptions": {
"type": "string",
"label": "SSN",
"pattern": "^(?!666|000|9\d{2})\d{3}(?!00)\d{2}(?!0{4})\d{4}$)",
"required": false
},
"expressionProperties": {
"templateOptions.validate": {
"messages": {
"pattern": "error field: FormState.sample => ${field.formControl.value} SSN can only be numbers without dashes, letters or special characters!"
},
"templateOptions.readonly": "formState.model.viewOnly",
"templateOptions.required": "formState.model.viewOnly"
}
}
},