먼저 아래 코드를 넣어서 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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5777 | 10년 전 | 452 | ||
| 5776 | 10년 전 | 300 | ||
| 5775 | 10년 전 | 231 | ||
| 5774 | 10년 전 | 914 | ||
| 5773 | 10년 전 | 265 | ||
| 5772 | 10년 전 | 297 | ||
| 5771 | 10년 전 | 413 | ||
| 5770 | 10년 전 | 374 | ||
| 5769 | 10년 전 | 220 | ||
| 5768 | 10년 전 | 277 | ||
| 5767 | 10년 전 | 1151 | ||
| 5766 | 10년 전 | 379 | ||
| 5765 | 10년 전 | 461 | ||
| 5764 | 10년 전 | 424 | ||
| 5763 | 10년 전 | 373 | ||
| 5762 | 10년 전 | 224 | ||
| 5761 | 10년 전 | 370 | ||
| 5760 | 10년 전 | 416 | ||
| 5759 | 10년 전 | 835 | ||
| 5758 | 10년 전 | 313 | ||
| 5757 | 10년 전 | 384 | ||
| 5756 | 10년 전 | 350 | ||
| 5755 | 10년 전 | 365 | ||
| 5754 | 10년 전 | 248 | ||
| 5753 | 10년 전 | 428 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기