쓸만한 주저리

file 태그의 버튼을 그림으로 바꾸기

봄돌73 2008. 7. 16. 11:45

<table width="342"  border="0" cellspacing="0" cellpadding="0" style="margin-left:10 ">
        <tr>
          <td><input type="text" name="upfiletext" style="width:266px" readonly></td>
          <td width=76 style=position:relative>
            <span style="position:absolute;height:18;width:71;top:2;background-image:url(http://images2.mylisten.com/neoStore/popup_btn_find.gif);clip:rect(0 71 18 0)">
              <input type=file name=upfile id=upfile style="width:0;height:22;position:absolute;top:-2;left:-8;filter:alpha(opacity=0);" onchange="if(this.value.indexOf('.gif')>0 || this.value.indexOf('.jpg')>0){document.getElementById('upfiletext').value=this.value}else{alert('gif나 jpg 파일만 가능합니다.');document.getElementById('upfiletext').value=''}">
            </span>
          </td>
        </tr>
      </table>