function confirm(){ var writeForm = document.writeForm; var upload =document.fileForm; for(var i =0 ;i<writeForm.length-4;i++){ if(writeForm.elements[i].value == ""){ window.alert("빈칸을 채워주세요"); writeForm.elements[i].focus(); return; } } var email1= document.getElementById("inputEmail").value; var email2= document.getElementById("inputDomain").value; if(email2.indexOf(".") == -1){ alert("이메일 주소에'.'<--를 포함 시켜주세요"); } var email2Array = email2.split("."); if(email2Array[0].length<2 || email2Array[1].length<2){ alert("이메일 형식이 잘못되었습니다."); }else{ var email = eamil1+"@"+email2; writeForm.submit(); } }