我有以下代码..目前正在验证,但它没有逐一显示错误消息我想一次显示所有错误消息... plz帮我提前谢谢
if ( $('#employeeid').length > 0 ) {
if ( $('#employeeid').val() || $('#employeeid').val() == '' ) {
if( ! $('#employeeid').val().match(/^[I]{1}[BH]{1}[0-9]{1,4}$/i) ) {
$('#employeeid-element').append('<ul class="errors"><li><ul class="errors"><li>Please enter a valid employee id</li></ul>');
return false;
}
}
}
if ( $("#firstname").val() || $("#firstname").val() == '') {
if( ! $('#firstname').val().match(/^[a-z]{0,10}[\s]{0,2}[a-z]{0,10}$/i) ) {
$('#firstname-element').append('<ul class="errors"><li>Please enter a employee first name: firstname</li></ul>');
return false;
}
}