Last active
May 13, 2018 10:16
-
-
Save kettanaito/02bb10348938caf544fcbea516f47b8f to your computer and use it in GitHub Desktop.
React Advanced Form - Validation messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/validation-messages.js | |
export default { | |
generic: { | |
missing: 'Please provide the required field', | |
invalid: 'The value you have provided is invalid' | |
}, | |
type: { | |
email: { | |
missing: 'Please provide the e-mail', | |
invalid: ({ value }) => `The e-mail "${value}" has invalid format` | |
}, | |
password: { | |
invalid: 'The password you entered is invalid', | |
rule: { | |
capitalLetter: 'Include at least one capital letter', | |
minLength: 'Password must be at least 6 characters long' | |
} | |
} | |
}, | |
name: { | |
confirmPassword: { | |
rule: { | |
matches: 'The passwords do not match' | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment