if (!isValid) {
alert('请输入必填项信息,并保证长度和格式正确!');
var errorField;
if (!!errors.required) {
errorField=errors.required[0].$name;
}
else if (!errorField&&!!errors.pattern) {
errorField = errors.pattern[0].$name;
}
else if (!errorField &&!!errors.maxlength) {
errorField = errors.maxlength[0].$name;
}
angular.element(document).find('[name="'+ errorField+'"]').focus();
return;
}