I send form values to a method and I’m using this SimpleSchema for validation.
new SimpleSchema({
id : { type: String, regEx: SimpleSchema.RegEx.Id },
key : { type: String },
value: { type: String }
})
So this works great for input or textarea values. But there are also checkboxes, which gives Boolean value (.is(:checked)
).
But I didn’t find any solution how to check for String
OR Boolean
value. How can I do that?
Something like
value: { type: String|Boolen }