当单击第一个表单的"File"按钮之后,再单击三次"提交一"才能进行表单提交;而单击第二个表单的"File"按钮,再单击两次"提交二"按钮才能提交,各位高手知道是什么原因吗?<form action="http://www.baidu.com">
<input type="file" name="j" style="display: none;" onchange="ye.value=value">
<input name="ye" style="color: green;border: 1px solid green">
<input type="button" value="File" onclick="j.click()" style="border: 1px solid green">
<input type="button" onclick="document.forms(0).submit()" value="提交一"/>
</form>
<br />
<form action="http://www.google.cn">
<input type="file" name="j" style="display: none;" onchange="ye.value=value">
<input name="ye" style="color: green;border: 1px solid green">
<input type="button" value="File" onclick="j.click()" style="border: 1px solid green">
<input type="submit" value="提交二"/>
</form>怎么写js代码,才能做到单击一次提交钮就是进行表单提交?
<input type="file" name="j" style="display: none;" onchange="ye.value=value">
<input name="ye" style="color: green;border: 1px solid green">
<input type="button" value="File" onclick="j.click()" style="border: 1px solid green">
<input type="button" onclick="document.forms(0).submit()" value="提交一"/>
</form>
<br />
<form action="http://www.google.cn">
<input type="file" name="j" style="display: none;" onchange="ye.value=value">
<input name="ye" style="color: green;border: 1px solid green">
<input type="button" value="File" onclick="j.click()" style="border: 1px solid green">
<input type="submit" value="提交二"/>
</form>怎么写js代码,才能做到单击一次提交钮就是进行表单提交?
解决方案 »
- js获取另一个页面的input值
- jquery 改变一个onclick的属性
- var $CommentUser =$('#CommentUser').val(); 我在c#中命名,$i 失败哟,js可以,好奇怪,大家说是不是
- 怎样才让在showModalDialog和showModelessDialog的超连接不弹出新窗口
- 字符串转换日期比较
- 求一段代码,定义一个页面的大小,随便把地址栏屏蔽掉
- 一个很麻烦的问题,请大家进来看看!
- 下拉菜单在1024*768和800*600的分辨率下怎么定位(用层)
- 如何通过javascript获取下拉菜单中的值
- 请问新浪的大广告是怎么做的
- js中光标焦点控制问题
- 文本框 按钮 下拉列表框 灰化问题
<html>
<head>
<title></title>
</head>
<body>
<form action="http://www.google.cn">
<input type="file" id="f" style="display:none;" onchange="document.getElementById('Y').value=this.value">
<input type="text" id="Y" style="color: green;border: 1px solid green">
<input type="button" value="File" onclick="document.getElementById('f').click();" style="border:1px solid green">
<input type="submit" value="提交">
</form>
</body>
</html>
<!-- 标签规范,并且name 替换为id ,'例子一' 一样替换就OK .本地测试通过 -->