개발하다가 남기면 좋을것 같아서 남겨 봅니다^^
먼저 아래 코드를 넣어서 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로 이쁘게 처리하면 되거나 이미지로 입혀도 되겠죠?
생각하는 개발자의 세상 웹디넷이었습니다.(http://www.webdy.net)
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5152 |
senseme
|
12년 전 | 4143 | |
| 5151 |
senseme
|
12년 전 | 3721 | |
| 5150 |
프로프리랜서
|
12년 전 | 3119 | |
| 5149 |
프로프리랜서
|
12년 전 | 3959 | |
| 5148 |
프로프리랜서
|
12년 전 | 4351 | |
| 5147 |
프로프리랜서
|
12년 전 | 1583 | |
| 5146 |
senseme
|
12년 전 | 2711 | |
| 5145 |
senseme
|
12년 전 | 2696 | |
| 5144 |
senseme
|
12년 전 | 1239 | |
| 5143 | 12년 전 | 1270 | ||
| 5142 | 12년 전 | 8393 | ||
| 5141 |
senseme
|
12년 전 | 1501 | |
| 5140 |
senseme
|
12년 전 | 3737 | |
| 5139 |
senseme
|
12년 전 | 6323 | |
| 5138 |
senseme
|
12년 전 | 1544 | |
| 5137 | 12년 전 | 1131 | ||
| 5136 |
senseme
|
12년 전 | 1304 | |
| 5135 |
senseme
|
12년 전 | 3287 | |
| 5134 |
senseme
|
12년 전 | 1067 | |
| 5133 |
senseme
|
12년 전 | 1811 | |
| 5132 |
senseme
|
12년 전 | 1240 | |
| 5131 |
senseme
|
12년 전 | 901 | |
| 5130 | 12년 전 | 1388 | ||
| 5129 | 12년 전 | 2101 | ||
| 5128 |
senseme
|
12년 전 | 1374 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기