<form name="form1" method="post" action="checkstore.jsp">
<table width="508" height="113" border="1" summary="dd">
<caption align="top">
<span class="style1"> 库存查询
</span>
</caption>
<tr>
<td width="87" height="40">货号<input type="checkbox" name="checkhuohao"> </td>
<td width="173"><input name="huohao" type="text"></td>
<td width="52">名称<input type="checkbox" name="checkmingcheng" ></td>
<td width="168"><input type="text" name="mingcheng"></td>
</tr>
</table>
<input type="submit" name="Submit" value="提交">
我想完成如果选中复选筐就把文本筐中的信息 提交数据库 ,应怎样在 下一页面 提交和设置呢?
<table width="508" height="113" border="1" summary="dd">
<caption align="top">
<span class="style1"> 库存查询
</span>
</caption>
<tr>
<td width="87" height="40">货号<input type="checkbox" name="checkhuohao"> </td>
<td width="173"><input name="huohao" type="text"></td>
<td width="52">名称<input type="checkbox" name="checkmingcheng" ></td>
<td width="168"><input type="text" name="mingcheng"></td>
</tr>
</table>
<input type="submit" name="Submit" value="提交">
我想完成如果选中复选筐就把文本筐中的信息 提交数据库 ,应怎样在 下一页面 提交和设置呢?
在网页中,如果checkbox没有被选中,后台是取不到值的。
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>Untitled Document</title>
</head><body>
<form name="form1" method="post" action="checkstore.jsp">
<table width="508" height="113" border="1" summary="dd">
<caption align="top">
<span class="style1"> 库存查询
</span>
</caption>
<tr>
<td width="87" height="40">货号<input type="checkbox" name="checkhuohao" > </td>
<td width="173"><input name="huohao" type="text"></td>
<td width="52">名称<input type="checkbox" name="checkmingcheng" onclick="alert(this.checked);if(this.checked) form1.submit();"></td>
<td width="168"><input type="text" name="mingcheng"></td>
</tr>
</table>
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
<script language="javascript">
function formsubmit()
{
if(document.form1.checkhuohao.checked==false){
document.form1.huohao.value="";
}else{
if (document.form1.huohao.value=="")
{
alert("请输入货号");
return false;
}
}
if(document.form1.checkmingcheng.checked==false)
{
document.form1.mingcheng.value="";
}else{
if (document.form1.mingcheng.value=="")
{
alert("请输入名称");
return false;
}
}
document.form1.submit();
}
</script>
<form name="form1" method="post" action="checkstore.jsp">
<table width="508" height="113" border="1" summary="dd">
<caption align="top">
<span class="style1"> 库存查询
</span>
</caption>
<tr>
<td width="87" height="40">货号<input type="checkbox" name="checkhuohao"> </td>
<td width="173"><input name="huohao" type="text"></td>
<td width="52">名称<input type="checkbox" name="checkmingcheng" ></td>
<td width="168"><input type="text" name="mingcheng"></td>
</tr>
</table>
<input type="button" name="Submit" value="提交" onClick="formsubmit()">
</form>