Force focus on invalid field after form validation
事實上, 要這麼寫:
if (this.getForm().isValid() == false){
var firstInvalid ;
this.getForm().items.each(function(f){
if(!f.isValid(true)){
firstInvalid = f;
}
});
if (firstInvalid) {
alert (firstInvalid ‘欄位不得為空白2’);
firstInvalid.focus();
}
//alert (‘欄位不得為空白’)
return;
}
alert (‘存檔完成’)