时间:06-06 互联网 佚名
原始的file控件是这样的:
别以为这个是由一个text和一个button组合成的,它是一个控件,html代码为:
<input type="file" name="file" />
<div class="file-box">
<form action="" method="post" enctype="multipart/form-data">
<input type='text' name='textfield' id='textfield' class='txt' />
<input type='button' class='btn' value='浏览...' />
<input type="file" name="fileField" class="file" id="fileField" size="28" onchange="document.getElementById('textfield').value=this.value" />
<input type="submit" name="submit" class="btn" value="上传" />
</form>
</div>
.file-box{ position:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }
效果图:
最后留下一个DEMO:点击查看demo
<script language="JavaScript">ffcod = delpost.runcode15 .value; ffcod = ffcod.replace(/
/g,''); delpost.runcode15 .value = ffcod;</script> 提示:您可以先修改部分代码再运行