まず、どのようにvarを使用してJavaScriptで10桁以上の数字を格納するには?
私は何をしていますか? ウェブページで私たちの製品の電子メールの制限を設定する必要があります。それはvalidation.Itのjavascriptで処理され、最大8桁の数字をうまく処理します。しかし、私たちのQAチームでは、他の電子メールフィールドのテキストボックスに17桁以上の数字を入力しています。それは否定的なメッセージを投げます。私は何をすることができますか?
私のサンプルコードは次のとおりです。
if(form.otherEmails) {
if(validEmailArray.endsWith(',')){
var otherEmailLength = validEmailArray.substring(0,validEmailArray.length-1).split(",");
var setLimitOtherEmail = window.parent.document.getElementById('setLimitOtherEmail').value;
if(setLimitOtherEmail == '-1'){
form.otherEmails.value = otherEmailLength;
}
else if(otherEmailLength.length <= setLimitOtherEmail){
form.otherEmails.value = otherEmailLength;
}
else{
alert("More than "+setLimitOtherEmail+ " " +"Recipient emailIds not allowed in this section.\nIf you want to send it to more recipients, Please create a Bulk Contact Group.");
form.otherEmails.focus();
return false;
}
}
else
form.otherEmails.value = validEmailArray;
}
ありがとう、あなたのコードはうまくいきます。 –