Closed nathanprins closed 7 years ago
I want to use SimpleSchema for checking if the email and emailCheck fields in my React form are indeed identical. But for some reason I can't seem to find this option in the docs, even though this seems like a logical thing to exist.
email
emailCheck
This is what I got right now:
export default UserSchema = new SimpleSchema({ firstName: { type: String, label: 'First Name', max: 100 }, lastName: { type: String, label: 'Last Name', max: 100 }, email: { type: String, regEx: SimpleSchema.RegEx.Email, }, verifyEmail: { type: String, regEx: SimpleSchema.RegEx.Email, } });
what I'd like to have is something like:
export default UserSchema = new SimpleSchema({ firstName: { type: String, label: 'First Name', max: 100 }, lastName: { type: String, label: 'Last Name', max: 100 }, email: { type: String, regEx: SimpleSchema.RegEx.Email, }, verifyEmail: { type: String, regEx: SimpleSchema.RegEx.Email, equals: email // <<<<------- } });
Am I missing something?
There is not a specific property for it but there are instructions here: https://github.com/aldeed/node-simple-schema#validate-one-key-against-another
I want to use SimpleSchema for checking if the
email
andemailCheck
fields in my React form are indeed identical. But for some reason I can't seem to find this option in the docs, even though this seems like a logical thing to exist.This is what I got right now:
what I'd like to have is something like:
Am I missing something?