document.form1.submit();不执行 怎么回事???

问题描述

function submitForm(){ <c:if test="${entity.type==2}"> if(${sessionScope.web_login_success==null}){ alert("请登录以后用积分兑换"); return; }else if('${sessionScope.web_login_success.integral}'<document.getElementById('numbers').value*${entity.reqintegral}){ alert("积分不足"); return; } </c:if>alert("这可以执行"); document.form1.submit(); }<form action="${ctx }/web/web_order_product!list.action" name="form1" id="form1" method="post"><input type="hidden" name="tokenh" id="tokenh" value="${token}" /><input type="hidden" name="step" id="step" value="1"/><input type="hidden" name="type" id="type" value="${entity.type}"/><input type="hidden" name="productid" id="productid" value="${entity.beanid}"/><input type="hidden" name="productname" id="productname" value="${entity.name}"/><input type="hidden" id="bianhao" name="bianhao" value="${entity.numbers}"/><input type="hidden" id="integral" name="integral" value="${entity.integral }"/><input type="hidden" id="reqintegral" name="reqintegral" value="${entity.reqintegral}"/><input type="hidden" id="productnumberName" name="productnumberName" id="productnumberName" value="${entity.model}"/><input type="hidden" id="price" name="price" value="${entity.sellingPrice}"/><input type="hidden" id="marketPrice" name="marketPrice" value="${entity.marketPrice}"/><input type="hidden" id="productnumber" name="productnumber" id="productnumber" value="${entity.model}"/> <li style="padding:10px 0 0 10px !important; padding:10px 0 0 10px;" ><a style="color:#FFF;position:absolute; " href="javascript:submitForm()"> <img src="${ctx}/web/images/buy.gif" width="125" height="40" /><a style="position:relative; top:38px; _*top:42px; color:#E40061;">(两步完成购买)</a></a></li> </ul> </div></form>这个页面上没有name=submit,但是提交的时候alert可执行,document.form1.submit();执行不了...这个怎么回事...

解决方案

有时候提交不了是你某个地方的js有错误,你把js从头到尾一点点注释掉,看看能不能提交,jquery通常出错是不报错的,我原来就遇到这个问题,什么错误都没有就是提交不了,后来把它前面的代码一点注释掉,发现前面有段代码有问题
解决方案二:
document.form[0].submit();

时间: 2024-08-30 11:08:06

document.form1.submit();不执行 怎么回事???的相关文章

js document.form.submit()表单提交实现代码

<script language="网页特效"> function submit2() {   var s=document.getelementbyid("ops教程");   alert(s.value); //显示正确结果,说明函数被执行   document.form.submit(); //没有按常规的submit() 去执行页面,能否有其它submit()方式 } </script> <form name="for

错误: &amp;amp;#x27;document.form1.Hidden1&amp;amp;#x27; 为空或不是对象

问题描述 在一个aspx页面中,有一个html控件input(隐藏),用于获取该页面中的一个插件的值.这个页面中还有一个html控件button,单击它时取得该页面中插件的值.页面代码如下面所示.<formid="form1"runat="server"><div><inputname="Hidden1"runat="server"id="Hidden1"type="

document.forms[].submit()使用

 这篇文章主要介绍了document.forms[].submit()使用,需要的朋友可以参考下 document.forms['exportServlet'].submit();    (1)document.forms:表示获取当前页面的所有表单    (2)document.forms[0]:表示获取当前页面的第一个表单    (3)document.forms['exportServlet']:表示获取当前页面的name="exportServlet"的表单    (4)sub

MVC中使用Knockout,json获取数据成功后,遍历填充视图模型时,代码不执行怎么回事

问题描述 MVC中使用Knockout,json获取数据成功后,遍历填充视图模型时,代码不执行怎么回事 function AppViewModel() { var self = this; self.brandstandards = ko.observableArray(); self.cart = ko.observableArray(); self.orders = ko.observableArray(); function BrandStandardViewModel(firstself

JavaScript document.form1.prov.options 为空或不为对象

问题描述 我要做一个省份和城市联动的控件.<selectname="prov"id="prov"onChange="changelocation(document.form1.prov.options[document.form1.prov.selectedIndex].value)"style="width:120px"language="javascript"onclick="retur

document.form1写法现在ie不识别的问题

问题描述 在以前系统中使用,一直都是正常的,最近开始,用户频繁反映在使用了此写法的页面,出现对象为空的提示,请问是因为系统升级还是ie现在的版本问题,如何解决,在线等,高分求解. 解决方案 解决方案二:这个写法只是在旧版本的IE中有效,建议都改为标准写法:document.getElementById解决方案三:标准写法是document.forms[0]或者document.forms["form1"]解决方案四:可能是名称默认不再是form1了,很简单的查看一下改掉就行.

document.forms[].submit()使用介绍_javascript技巧

document.forms['exportServlet'].submit(); (1)document.forms:表示获取当前页面的所有表单 (2)document.forms[0]:表示获取当前页面的第一个表单 (3)document.forms['exportServlet']:表示获取当前页面的name="exportServlet"的表单 (4)submit()表示提交函数

document.write()方法的执行方式

问题描述 <html><head><meta charset="utf-8"><title>无标题文档</title></head><body>asdf</body></html><script type="text/javascript">document.write("1");</script>这样一段代码执行的

在javascript中关于submit和button提交表单区别

原文:在javascript中关于submit和button提交表单区别   原文来自:http://www.jb51.net/article/42236.htm   submit是button的一个特例,也是button的一种,它把提交这个动作自动集成了,submit和button,二者都以按钮的形式展现,看起来都是按钮,所不同的是type属性和处发响应的事件上.        1. 如果表单在点击提交按钮后需要用JS进行处理(包括输入验证)后再提交的话,通常都必须把submit改成butto