要表单内"文件选择框"的值为空,应该怎么写??? if(document.form.文本框.value ==""{return true;} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if(document.formName.文本框.value ==""){return true;} if(条件){document.formName.reset();return true;} <input type=file name=myfile> 不可以定义默认value 不可以定义默认value 是什么意思,是不是不能设它的值为空??? 据我所知只要下面两种手段:<form name=test><input type=file><input type=reset></form><button onclick="document.test.reset()">clean</button> 当然也可以用假的,不过在submit前一定要先判断显示的内容是否为空,如为空则disabled掉file元素使它不发送。<form><input name="viewFile" readonly><span style="position:absolute;left:160"><input type=file name="realFile" onfocus="form.viewFile.value=value;" style="margin-left:-145"></span></form><button onclick="document.forms[0].viewFile.value=''">clean</button> 文件框直到IE6。0都不能直接赋值,不知为何,我想除了reset 表单框也别无办法了,我也想知道有没有其它办法。 Jquery中使用propertygrid显示问题 唉,我又遇到问题了,还是JS,有个问题还请各位帮忙,很急的, google地图的问题 通过javascript读取本地文件系统的问题 javascrip调用dll遇到的问题(在线等) 获取元素滚动后的可见高度! 能不能用做一个右拉式的菜单? 关于动态创建当选按钮的问题??? 奇怪的问题,只在我的机器上有 如何在鼠标移动时,让鼠标所处的坐标值显示在鼠标旁边 关于字符串的问题,大家帮忙啊!!!高分奉送 怎样顺利显示数据库中的一些特殊记录
{
return true;
}
document.formName.reset();
return true;
}
<form name=test>
<input type=file>
<input type=reset>
</form>
<button onclick="document.test.reset()">clean</button>
<input name="viewFile" readonly>
<span style="position:absolute;left:160">
<input type=file name="realFile" onfocus="form.viewFile.value=value;" style="margin-left:-145">
</span>
</form>
<button onclick="document.forms[0].viewFile.value=''">clean</button>