0
我有這個安全問題答案輸入字段驗證函數,我想確保字符串轉換爲小寫,以防用戶在第一個輸入答案現場,並在第二場小案例:我想使用Dojo使我的輸入字符串小寫
validate : function(){
//check if both input fields are not blank
//if not blank, check to see if they match and send back status message
var _inputs = dojo.query("#" + this.id + " input");
var _y = ""
var _matchingValues = [];
_this = this;
for(var i = 0, len = _inputs.length; i < len; i++) {
_matchingValues.push(_inputs[i].value);
}
dojo.forEach(_matchingValues, function(arr) {
if (arr == "") {
_this.status = "incomplete";
//_this.status = "invalid";
return _this.status;
}
else if (arr != _y) {
_y = arr;
_this.status = "nomatch";
return _this.status;
}
else if (arr.length < 3){
_this.status = "short";
return _this.status;
}
else {
_this.status = "valid";
return _this.status;
}
});
},
這怎麼可能完成
這在我重建了dojo配置文件後生效 – Amen 2010-10-25 15:13:51