关于<input type=file>问题 可以模拟一个file就是左边是input[text]右边是input[file]然后右边的z-index比左边的小。margin:负值这样右边的file的文本部分就被左边的text给盖住了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 安全问题,file字段不能赋值。在本机应用可以,htm改成hta。 就算用div模拟了,你提交时也不能获得file1的值(为空),除非你重新选择过file1 大概是这样的...不过,你要是想给file加默认值是不可能的..<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><div style="position:relative;"> <input id="wc" type="text" name="file" style="position:relative;z-index:2; background-color:#CCCCCC;" /> <input type="file" style="position:absolute;z-index:1;left:0;" onchange="document.getElementById('wc').value = this.value" /></div></body></html>仔细看了下你的需求,貌似,只是把file1和file2换下位置那么简单 - - extjs 导航菜单 解决Fckeditor浏览服务器文件时不能浏览所有文件 js代码不兼容Firefox,怎么改? textarea内值得的移动问题? 如何用正则表达式判断字符串内的特殊字符是否符合要求? 刷新的问题 高手拿分来呀!! 菜鸟问题! 如何在数据提交后弹出一个结果对话框,且父页面不刷新 为什么我的文件输入框加上accept="image/*"之后丝毫不起作用? JavaScript 与面向对象技术 在asp里怎么调用javascript参数的问题
不过,你要是想给file加默认值是不可能的..<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<div style="position:relative;">
<input id="wc" type="text" name="file" style="position:relative;z-index:2; background-color:#CCCCCC;" />
<input type="file" style="position:absolute;z-index:1;left:0;" onchange="document.getElementById('wc').value = this.value" />
</div>
</body>
</html>仔细看了下你的需求,貌似,只是把file1和file2换下位置那么简单 - -