특정 이메일 입력 금지및 이메일 유효성 검사하기 입니다.

· 10년 전 · 172

daum, naver, yahoo,hanmail 계정은 입력할 수 없습니다<br>
 
<form name="validation" onSubmit="return checkbae()">
이메일 주소 입력 :
<input type="text" size=18 name="emailcheck"><br>
<input type="submit">
</form>
 
<script language="JavaScript1.2">
 
var invalidaddress=new Array()
invalidaddress[0]="daum"
invalidaddress[1]="naver"
invalidaddress[2]="yahoo"
invalidaddress[3]="hanmail"
 
var testresults
function checkemail(){
var invalidcheck=0;
var str=document.validation.emailcheck.value
var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str)){
var tempstring=str.split("@")
tempstring=tempstring[1].split(".")
for (i=0;i<invalidaddress.length;i++){
if (tempstring[0]==invalidaddress[i])
invalidcheck=1
}
if (invalidcheck!=1)
testresults=true
else{
alert("입력 금지된 계정입니다")
testresults=false
}
}
else{
alert("이메일 주소가 유효하지 않습니다")
testresults=false
}
return (testresults)
}
function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}
</script> 

|
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
10년 전 조회 287
10년 전 조회 770
10년 전 조회 249
10년 전 조회 269
10년 전 조회 176
10년 전 조회 710
10년 전 조회 312
10년 전 조회 291
10년 전 조회 354
10년 전 조회 359
10년 전 조회 390
10년 전 조회 265
10년 전 조회 173
10년 전 조회 271
10년 전 조회 199
10년 전 조회 216
10년 전 조회 184
10년 전 조회 236
10년 전 조회 242
10년 전 조회 285
10년 전 조회 202
10년 전 조회 220
10년 전 조회 388
10년 전 조회 233
10년 전 조회 285