Fix: input type text -> number for player enter code
This commit is contained in:
@@ -73,11 +73,11 @@ AccountValidator.prototype.isValidPlayerPW = function(textPW) {
|
||||
|
||||
AccountValidator.prototype.messageForInvalidPlayerPW = function(textPW) {
|
||||
if(textPW.length < Number(AccountValidator.PLAYER_PW_LENGTH_MINIMUM))
|
||||
return "학생 입장 번호는 " + AccountValidator.PLAYER_PW_LENGTH_MINIMUM + "글자 이상의 숫자로만 입력해 주세요.";
|
||||
return "학생 입장 번호는 " + AccountValidator.PLAYER_PW_LENGTH_MINIMUM + "자리 이상의 숫자로 입력해 주세요.";
|
||||
else if(textPW.length > Number(AccountValidator.PLAYER_PW_LENGTH_MAXIMUM))
|
||||
return "학생 입장 번호는 " + AccountValidator.PLAYER_PW_LENGTH_MAXIMUM + "글자 이하의 숫자로만 입력해 주세요.";
|
||||
return "학생 입장 번호는 " + AccountValidator.PLAYER_PW_LENGTH_MAXIMUM + "자리 이하의 숫자로 입력해 주세요.";
|
||||
else
|
||||
return "학생 입장 번호는 2~6자리 숫자로 입력해 주세요.";
|
||||
return "학생 입장 번호는 2~8자리 숫자로 입력해 주세요.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -149,11 +149,26 @@ PlayerListManager.prototype.editPlayer = function(inputButton) {
|
||||
|
||||
var name = $(inputButton).siblings(".player_name");
|
||||
var playerName = name.val();
|
||||
// console.log(playerName);
|
||||
console.log(playerName);
|
||||
|
||||
var enterCode = $(inputButton).siblings(".player_entercode");
|
||||
var playerEnterCode = enterCode.val();
|
||||
// console.log(playerEnterCode);
|
||||
console.log(playerEnterCode);
|
||||
|
||||
if(!accountValidator.isValidPlayerID(playerName)) {
|
||||
// console.log("Error - playerName : " + playerName);
|
||||
onErrorPlayerName(accountValidator.messageForInvalidPlayerID(playerName));
|
||||
return;
|
||||
} else if(!accountValidator.isValidPlayerPW(playerEnterCode)) {
|
||||
// console.log("Error - enterCode : " + enterCode);
|
||||
// onErrorPlayerPW(accountValidator.messageForInvalidPlayerPW(playerEnterCode));
|
||||
showErrorMessage(accountValidator.messageForInvalidPlayerPW(playerEnterCode), "error");
|
||||
|
||||
$(enterCode).focus();
|
||||
$(enterCode).select();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/player/edit_player.php",
|
||||
|
||||
Reference in New Issue
Block a user