here is my form: can i set validation rules inside this definition or have i
to validate over it by hand with conditional statements or is something like this already build in?
i would like to set for learning purposes the minlength to 20 without conditionals of my own.
or shall i extend the plugin by including them in the plugin file?
var form1 = new Backbone.Form({
schema: {
country: { type: 'Select', options: ['UK', 'USA'] },
city: { type: 'Select', options: cities.UK },
message: { validators: ['required', 'message'] }
}
}).render();
You can define a minimum length rule as a regular expression:
All the validation options are documented here.