board.js 안에 verify_data()에
show_waiting(); 바로 위에 아래 소스를 추가하세요
if(document.theForm.strImgFileName != null){
var ext;
var cnt;
if(document.theForm.strImgFileName.length != null){
cnt = document.theForm.strImgFileName.length
for(cnt_i = 0;cnt_i <= cnt-1 ;cnt_i++ ){
ext = document.theForm.strImgFileName[cnt_i].value;
ext = ext.substring(ext.length-3,ext.length);
ext = ext.toLowerCase();
if((ext != 'jpg' && ext != 'jpeg' && ext != 'gif') && document.theForm.strImgFileDelete[cnt_i] == null){
alert("jpg또는 gif파일을 등록하세요.");
document.theForm.strImgFileName[cnt_i].focus();
return;
}
}
}else if(document.theForm.strImgFileName != null){
ext = document.theForm.strImgFileName.value;
ext = ext.substring(ext.length-3,ext.length);
ext = ext.toLowerCase();
if((ext != 'jpg' && ext != 'jpeg' && ext != 'gif') && document.theForm.strImgFileDelete == null){
alert("jpg또는 gif파일을 등록하세요.");
document.theForm.strImgFileName.focus();
return;
}
}
}
파란색 조건문이 바꼈습니다. 기존에건 게시
댓글 2