Break JavaScript When run document.forms[0].submit();
Break JavaScript When run document.forms[0].submit();
onchange="document.forms[0].action = 'policyTypeSelection.do?method=policyTypeSelection'; document.forms[0].submit(); optionCheck(this);">
optionCheck(this);
是Java脚本:
function optionCheck(frm) {
var i, len, optionVal, helpDiv, btnStatus,
selectOptions = document.getElementById("options").submit();
// loop through the options in case there
// are multiple selected values
for (i = 0, len = selectOptions.options.length; i < len; i++) {
// get the selected option id
optionVal = selectOptions.options[i].id;
// find the corresponding help div
helpDiv = document.getElementById("help");
Statussecond = document.getElementById("second");
Statusfirst = document.getElementById("first");
// move on if we didn't find one
if (!helpDiv) { continue; }
// set CSS classes to show/hide help div
if (selectOptions.options[i].selected) {
helpDiv.className = "helpTextShow";
Statussecond.className = "hiddenShow";
Statusfirst.className = "none";
}
}
}
document.getElementById("options"(.submit(( 应更改为document.getElementsByTagName("option"(
而且在检查之前提交是不合理的。如果 document.forms[0].submit(( 提交表单,页面将被重新加载,并且永远不会执行 optionCheck(this(。
相关文章:
- jQuery.when()在循环中被忽略
- jQuery submit()的角度等效项
- Javascript form.submit()方法是如何工作的
- 如何在submit to sightly时将表单输入值作为参数传递给WCMUsePojo
- This.Form.Submit() on CakePHP
- 未捕获错误:语法错误,无法识别的表达式:input[@type=submit]
- jQuery函数无法处理Form Submit
- 为什么$.when().pipe().then()有效,而$.when
- 为什么有些jQuery程序员使用像$.get、$.getJSON和$.when这样的jQuery函数来代替$.ajax
- 为什么表单元素不应命名为submit
- javascript表单字段submit:Object dos'在IE8中不支持此属性或方法
- 通过$.when传播进度通知
- 单选按钮的验证(启用)&使用Jquery Optimization从复选框中选择submit按钮
- 如何使用SpringWebFlow在JavaScript中处理form.submit()
- onsubmit返回false,但submit仍然执行
- Bootstrap-Datepicker not selecting date when using "set
- angularjs formly submit bug in safari & IE 11
- 如何获得<html:submit>按钮是在javascript中单击的
- this.form.submit()无法正常使用php
- Break JavaScript When run document.forms[0].submit();