개발하다가 남기면 좋을것 같아서 남겨 봅니다^^
먼저 아래 코드를 넣어서 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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5127 |
senseme
|
12년 전 | 1271 | |
| 5126 |
senseme
|
12년 전 | 1796 | |
| 5125 |
kiplayer
|
12년 전 | 14723 | |
| 5124 | 12년 전 | 1082 | ||
| 5123 | 12년 전 | 2739 | ||
| 5122 |
senseme
|
12년 전 | 8953 | |
| 5121 | 12년 전 | 1295 | ||
| 5120 |
프로프리랜서
|
12년 전 | 1187 | |
| 5119 |
프로프리랜서
|
12년 전 | 1653 | |
| 5118 |
프로프리랜서
|
12년 전 | 1161 | |
| 5117 |
프로프리랜서
|
12년 전 | 1305 | |
| 5116 |
프로프리랜서
|
12년 전 | 3552 | |
| 5115 |
프로프리랜서
|
12년 전 | 1492 | |
| 5114 |
프로프리랜서
|
12년 전 | 2143 | |
| 5113 |
senseme
|
12년 전 | 1320 | |
| 5112 |
senseme
|
12년 전 | 3039 | |
| 5111 | 12년 전 | 1360 | ||
| 5110 | 12년 전 | 1607 | ||
| 5109 | 12년 전 | 2038 | ||
| 5108 |
senseme
|
12년 전 | 1050 | |
| 5107 |
senseme
|
12년 전 | 1088 | |
| 5106 | 12년 전 | 4440 | ||
| 5105 |
senseme
|
12년 전 | 1499 | |
| 5104 |
senseme
|
12년 전 | 1638 | |
| 5103 | 12년 전 | 5491 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기