Force focus on invalid field after form validation

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 (‘存檔完成’)

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 6 + 8 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)