Add validator to user form for consistent validation
This commit is contained in:
parent
923313dafa
commit
cdcc954cf6
@ -9,6 +9,12 @@ export default {
|
||||
unmask: [],
|
||||
validationError: 'Please enter a response'
|
||||
},
|
||||
requiredField: {
|
||||
mask: false,
|
||||
match: /.+/,
|
||||
unmask: [],
|
||||
validationError: 'This field is required'
|
||||
},
|
||||
integer: {
|
||||
mask: createNumberMask({ prefix: '', allowDecimal: false }),
|
||||
match: /^[1-9]\d*$/,
|
||||
|
@ -9,11 +9,11 @@
|
||||
<div class='panel__content'>
|
||||
<div class='form-row'>
|
||||
<div class='form-col form-col--half'>
|
||||
{{ TextInput(form.first_name) }}
|
||||
{{ TextInput(form.first_name, validation='requiredField') }}
|
||||
</div>
|
||||
|
||||
<div class='form-col form-col--half'>
|
||||
{{ TextInput(form.last_name) }}
|
||||
{{ TextInput(form.last_name, validation='requiredField') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user