Add validation
This commit is contained in:
parent
b13ba188bf
commit
2dd1822cf8
@ -47,6 +47,12 @@ export default {
|
||||
unmask: ['(',')','-',' '],
|
||||
validationError: 'Please enter a 10-digit phone number'
|
||||
},
|
||||
phoneExt: {
|
||||
mask: [/\w/, /\w/, /\w/, /\w/, /\w/, /\w/, /\w/, /\w/, /\w/, /\w/],
|
||||
match: /^\w*$/,
|
||||
unmask: [],
|
||||
validationError: 'Optional: Please enter up to 10 characters'
|
||||
},
|
||||
dodId: {
|
||||
mask: createNumberMask({ prefix: '', allowDecimal: false, includeThousandsSeparator: false }),
|
||||
match: /^\d{10}$/,
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{ TextInput(phone_number, placeholder=placeholder_phone, validation='usPhone') }}
|
||||
</div>
|
||||
<div class='phone-input__extension'>
|
||||
{{ TextInput(phone_ext)}}
|
||||
{{ TextInput(phone_ext, validation='phoneExt')}}
|
||||
</div>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user