mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
Use regex test instead of match (#1016)
This commit is contained in:
parent
9beec28eeb
commit
a294a3b977
1 changed files with 2 additions and 2 deletions
|
|
@ -37,14 +37,14 @@ class ManageOrgUsers extends React.Component {
|
|||
if (!fields['firstName']) {
|
||||
errors['firstName'] = 'This field is required';
|
||||
} else if (typeof fields['firstName'] !== 'undefined') {
|
||||
if (!fields['firstName'].match(/^[a-zA-Z]+$/)) {
|
||||
if (!/^[a-zA-Z]+$/.test(fields['firstName'])) {
|
||||
errors['firstName'] = 'Only letters are allowed';
|
||||
}
|
||||
}
|
||||
if (!fields['lastName']) {
|
||||
errors['lastName'] = 'This field is required';
|
||||
} else if (typeof fields['lastName'] !== 'undefined') {
|
||||
if (!fields['lastName'].match(/^[a-zA-Z]+$/)) {
|
||||
if (!/^[a-zA-Z]+$/.test(fields['lastName'])) {
|
||||
errors['lastName'] = 'Only letters are allowed';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue