Nh v d trn th tn hm c a chng ta s l

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: onSetFocus - Ti p theo t giá tr c a bi n ignoreSetFocus là False, chúng ta s s d ng này sau CODE ignoreSetFocus = false; - Ti p theo chúng ta vi t hàm onSetFocus b t event. CODE this.onSetFocus = function(oldFocus, newFocus) { // this is a focus reset, so ignore if (ignoreSetFocus) { ignoreSetFocus = false; return(0); } // use the appropriate check function if (oldFocus == userName) { ret = checkUserName(); } else if (oldFocus == userYear) { ret = checkUserYear(); } else if (oldFocus == userEmail) { ret = checkUserEmail(); } n bi n if (!ret) { // ignore this focus change and go back ignoreSetFocus = true; Selection.setFocus(oldFocus); } } Hàm này s nh n hai i s . i s th nh t là textfield tr ơc khi chuy n focus và s th hai là textfield sau khi chuy n focus. Hàm checkUserName s ki m tra tên ngư i dùng CODE // tên ph i có ít nh t 3 ký t function checkUserName() { if (userNameText.length < 3) { feedback = "B n ph i nh p ít nh t 3 ký t " return(false); } //...
View Full Document

This note was uploaded on 01/16/2013 for the course BANKING 111 taught by Professor Johnsmith during the Spring '13 term at University of Economics and Technology.

Ask a homework question - tutors are online