양식을 등록 할 때 내 회사 전자 메일 ID의 유효성을 검사하려고합니다 ... 양식에서 회사의 메일 ID 만 허용하도록합니다. 이제 유효성 검사 후 문제가 발생합니다 (즉, 제출 버튼을 클릭하면 우리는자바 스크립트를 사용하여 가입 양식의 맞춤 도메인을 확인 하시겠습니까?
내 자바 스크립트 방법은 ... 양식을 새로 고칠지고 그리고 그것은 사전에 감사 ?? 갱신되지 않도록 입력 된 값이 ... 그래서 어떤 도움이나 제안을 지워집니다) 경고 메시지가 :
function submitAlbum() {
var frm = document.getElementById("frmRegistration");
//validateEmail(document.getElementById('email').value);
var email = document.getElementById('email').value;
var re = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
if (re.test(email)) {
if (email.indexOf('@bdisys.com', email.length - '@bdisys.com'.length) !== -1) {
// alert('Submission was successful.');
var r = confirm("Are You Sure You Want to add your details.");
if (r == true) {
frm.action = "signUpServlet?formidentity=doRegistration&checkboxStatus=" + checkboxStatus;
frm.submit();
}
}
else {
document.getElementById('email').focus();
alert('Email must be a Company e-mail address ([email protected]).');
return false;
}
}
else {
document.getElementById('email').focus();
alert('Not a valid e-mail address.');
return false;
}
}
시도. – Jai
내 대답을 편집했습니다. 확인하시기 바랍니다 – Konza