먼저 아래 코드를 넣어서 file type을 0으로 줄인다.
<style>
#file { width:0; height:0; }
</style>
<script>
$j(function(){
$j('#btn-upload').click(function(e){
e.preventDefault();
$j("input:file").click();
var ext = $j("input:file").val().split(".").pop().toLowerCase();
if($j.inArray(ext, ["gif","png","jpg","jpeg"]) == -1) {
alert("gif,png,jpg 파일만 업로드 할수 있습니다.");
return false;
}
$j("input:file").val().toLowerCase();
});
});
</script>
그리고 html내에
<input type='file' id='file' name='file' />
<button id='btn-upload' class="button1 white selected" onfocus="this.blur();">사업자등록증 첨부</button>
이렇게 해주면 깔금하게 버튼 하나로만 처리되어집니다.
버튼에는 css로 이쁘게 처리하면 되거나 이미지로 입혀도 되겠죠?
게시판 목록
팁게시판
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 152 | 20년 전 | 4917 | ||
| 151 | 20년 전 | 4553 | ||
| 150 | 20년 전 | 3497 | ||
| 149 | 20년 전 | 3771 | ||
| 148 | 20년 전 | 7048 | ||
| 147 | 20년 전 | 3531 | ||
| 146 | 20년 전 | 2607 | ||
| 145 | 20년 전 | 2610 | ||
| 144 | 20년 전 | 7157 | ||
| 143 | 20년 전 | 4568 | ||
| 142 | 20년 전 | 1881 | ||
| 141 | 20년 전 | 3238 | ||
| 140 | 20년 전 | 1953 | ||
| 139 | 20년 전 | 1545 | ||
| 138 | 20년 전 | 2298 | ||
| 137 | 20년 전 | 1799 | ||
| 136 | 20년 전 | 1456 | ||
| 135 | 20년 전 | 1804 | ||
| 134 | 20년 전 | 2976 | ||
| 133 | 20년 전 | 2414 | ||
| 132 | 20년 전 | 1722 | ||
| 131 | 20년 전 | 1652 | ||
| 130 | 20년 전 | 4003 | ||
| 129 | 20년 전 | 2925 | ||
| 128 | 20년 전 | 3634 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기