如何使用Javascript实现对表单中指定数据的提交? javascript 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 form表单去掉改用ajax提交<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>function submit(){ $.post("./pass.php?do=login", { name: "John"} ); } ajax不是很会用,具体代码该怎么写呢? <!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=utf-8" /><title>无标题文档</title><script type="text/javascript">function submits(){ var form=document.getElementById('loginform'); var eles=form.elements; for(var i=0,len=eles.length;i<len;i++){ if(eles[i].getAttribute('not_submit')=='true'){ eles[i].disabled=true; } } form.submit();}</script></head><body><form id="loginform" name="loginformName" action="http://www.baidu.com" method="post" > <div class="placeholder">邮箱或昵称</div> <input class="ipt iptlong" type="text" value="" name="account" > <div class="placeholder">密码</div> <input class="ipt" type="password" value="" name="password" not_submit='true'> <input type="button" value="" onclick="submits();"></form></body></html>类似这样试试 怎么用js显示text文本中的内容? 关于window.history javascriipt 解析json问题,请大家帮忙看看! 模拟js 事件 css 问题 JavaScript没有static成员变量,那怎样让成员变量只赋值一次? 怎么样用JS播放音乐 就刚才问题继续发问,HTC控件问题 可以获得框架中某个新页面的URL吗? 想学点JavaScript,可是我就是不知道为什么仅仅光 checkbox 就搞的我头大?如果还有人给点信心的话,就先谢过了. 有个关于iframe跨域上传的问题,求高手指导 jsp单击行获取该行id,并传给servlet
改用ajax提交
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
function submit(){
$.post("./pass.php?do=login", { name: "John"} );
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function submits(){
var form=document.getElementById('loginform');
var eles=form.elements;
for(var i=0,len=eles.length;i<len;i++){
if(eles[i].getAttribute('not_submit')=='true'){
eles[i].disabled=true;
}
}
form.submit();
}
</script>
</head><body>
<form id="loginform" name="loginformName" action="http://www.baidu.com" method="post" >
<div class="placeholder">邮箱或昵称</div>
<input class="ipt iptlong" type="text" value="" name="account" >
<div class="placeholder">密码</div>
<input class="ipt" type="password" value="" name="password" not_submit='true'>
<input type="button" value="" onclick="submits();">
</form>
</body>
</html>类似这样试试