제이쿼리 업로드 질문이요

제이쿼리 업로드 질문이요

QA

제이쿼리 업로드 질문이요

답변 1

본문

우선적으로 밑에 똑같은 소스가 5개정도가 있어요 [예시로 하나정도를..]

거기서 업로드 버튼을 클릭하면 클릭한 한줄에서 업로드가 비워있으면 비워있다고 알림창 뜨거든요

근데 파일을 업로드하고나서 업로드버튼을 누르니까 계속 알림창이 뜨네요.. 뭐가 문제일까요... 조건문 다음으로 넘어가지 않아요

 

 

<tr class="imgbox" data-num="1">
                        <td class="bl cnt">이미지</td>
                        <td>
                            <input type="hidden" name="img_alt[]" value="이미지1">
                            <i class="fa fa-download"></i><input type="file" name="bf_file[]" accept="image/*" class="bffile frm_file">
                            <button type="button" class="btnUpload btn_submit btn">업로드</button>
                                                    </td>
                    </tr>

.....

 

 

$('.btnUpload').on('click', function () {
    var trlength = $(this).closest('.imgbox').data('num');
    if($(!$.trim($(this).closest('.imgbox').find("input[type='file']").val()))) {
        alert("파일을 업로드해주세요. #"+trlength);
        $(this).closest('.imgbox').find('.bffile').focus();
        return false;
    }else {

       }

});

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
filter #sql ×
전체 722
© SIRSOFT
현재 페이지 제일 처음으로