Closed yzhang closed 11 years ago
Something simple but brilliant! I myself had not encountered such a need. Very thanks! Also will implemented in the next version.
// Lenght count
// An lenght min
fieldLenghtMin = field.data('minlenght'), fieldLenghtMax = field.data('maxlenght'),
if(fieldLenghtMin !== undefined && fieldLenghtMin !== '0'){
var Lenght = field.val().length;
if( Lenght < fieldLenghtMin){
status.required = false;
}
if( Lenght > fieldLenghtMax){
status.required = false;
}
}
If form validation failed, the event propagation should be stopped to prevent the subsequent event handers bound to form's submit event be executed.