먼저 아래 코드를 넣어서 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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5977 | 9년 전 | 176 | ||
| 5976 | 9년 전 | 224 | ||
| 5975 | 9년 전 | 251 | ||
| 5974 | 9년 전 | 351 | ||
| 5973 | 9년 전 | 387 | ||
| 5972 | 9년 전 | 234 | ||
| 5971 | 9년 전 | 265 | ||
| 5970 | 9년 전 | 230 | ||
| 5969 | 9년 전 | 150 | ||
| 5968 | 9년 전 | 156 | ||
| 5967 | 9년 전 | 339 | ||
| 5966 | 9년 전 | 200 | ||
| 5965 | 9년 전 | 188 | ||
| 5964 | 9년 전 | 189 | ||
| 5963 | 9년 전 | 270 | ||
| 5962 | 9년 전 | 331 | ||
| 5961 | 9년 전 | 242 | ||
| 5960 | 9년 전 | 281 | ||
| 5959 | 9년 전 | 217 | ||
| 5958 |
|
9년 전 | 485 | |
| 5957 | 9년 전 | 316 | ||
| 5956 | 9년 전 | 283 | ||
| 5955 | 9년 전 | 293 | ||
| 5954 | 9년 전 | 204 | ||
| 5953 | 9년 전 | 348 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기