当前位置: 代码迷 >> Web前端 >> 弹出资料选择框
  详细解决方案

弹出资料选择框

热度:55   发布时间:2012-10-14 14:55:08.0
弹出文件选择框
<input type="text" class="char28Col" id="text1" />
<input type="file" id="file1" class="char32Col" style="display: none;" />
<input type="button" class="deepgrayButton" value="参照" onclick="file1.click();text1.value=file1.value;" />
这种方法会报“拒绝访问的错误”

改用下面的方法
.hiddenFile
{
position:absolute;filter:alpha(opacity=0);width:30px;" hidefocus
}

<INPUT type="file" name="uploadFile" size="50" maxlength="256" class="hiddenFile" onchange="return upload();"/>
<ns:button property="btnAttachment" style="width:55px"><bean:message key="label.addto"/></ns:button> 基本实现预定效果
  相关解决方案