JQUERY $("form:first").submit();在IE6下面不执行,咱整
解决方案 »
- 请问这段代码的问题怎么解决?
- c#后台如何利用获取JS动态生成的<input type="text">的值并存入字符串数组中??
- 从jQuery看JavaScript
- MAX_VALUE
- 用XMLHttpRequest模拟form提交 求助……急
- JAVASCRIPT如何在创建前判断EXCEL文件是否存在,如果存在就先删除该文件
- 为什么加了<span></span>就不起作用了
- 一个关于瀑布流的问题
- 在地址栏中输入javascript方法,是原来的方法失效
- select 使用onchange()事件后 提交后显示不是一个有效的function
- jquery each swicth一个很奇诡的问题
- ext extend函数的疑问
这样就可以了
$("form").get(0).submit();
这个是我的代码function fixBlockID(strBlockID)
{
$("#txtBlockID").val(strBlockID);
$("form:first").submit();
}
<!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>
<style>
p { margin:0; color:blue; }
div,p { margin-left:10px; }
span { color:red; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p>Type 'correct' to validate.</p>
<form action="javascript:alert('success!');">
<div>
<input type="text" /> <input type="submit" />
</div>
</form>
<span></span>
<script>
$("form:first").submit(function() {
if ($("input:first").val() == "correct") {
$("span").text("Validated...").show();
return true;
}
$("span").text("Not valid!").show().fadeOut(3000);
return false;
});
</script>
</body>
</html>我这个代码是可以的楼主对照一下