jq提交表单的问题,求高手解惑!
代码如下<!DOCTYPEhtml><html><headlang="en"><metacharset="UTF-8"><title></title></head><sc...
代码如下
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<script src="jquery-1.9.1.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$("#chk_char").click(function(){
$("#form1").submit();
});
});
</script>
<body>
<div align="center" style=" margin-top:150px">
<p style="color:#036; font-weight:bold">用户登录:</p>
<form action="denglu2.php" method="post" id="form1" >
<table height="150px">
<tr>
<td width="67">账号:</td>
<td colspan="2"><input type="text" name="username"/> </td>
</tr>
<tr>
<td>密码:</td>
<td colspan="2"><input type="password" name="userpassword" />
</td>
</tr>
<tr>
<td>验证码:</td>
<td width="75"><input type="text" maxlength="4" name="code" size="11" id="code_char"/>
</td>
<td width="86"><img src="code_char.php" id="getcode_char" title="看不清,点击换一张" align="absmiddle">
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="button" value="登录" name="submit"
id="chk_char"/>
<input type="reset" value="重填" />
</body>
想用jq实现按钮提交表单的结果,为什么点击按钮没反应?哪里出问题了? 展开
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<script src="jquery-1.9.1.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$("#chk_char").click(function(){
$("#form1").submit();
});
});
</script>
<body>
<div align="center" style=" margin-top:150px">
<p style="color:#036; font-weight:bold">用户登录:</p>
<form action="denglu2.php" method="post" id="form1" >
<table height="150px">
<tr>
<td width="67">账号:</td>
<td colspan="2"><input type="text" name="username"/> </td>
</tr>
<tr>
<td>密码:</td>
<td colspan="2"><input type="password" name="userpassword" />
</td>
</tr>
<tr>
<td>验证码:</td>
<td width="75"><input type="text" maxlength="4" name="code" size="11" id="code_char"/>
</td>
<td width="86"><img src="code_char.php" id="getcode_char" title="看不清,点击换一张" align="absmiddle">
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="button" value="登录" name="submit"
id="chk_char"/>
<input type="reset" value="重填" />
</body>
想用jq实现按钮提交表单的结果,为什么点击按钮没反应?哪里出问题了? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询