php一个表单有两个提交按钮,分别对应不同的处理页面,应该怎么实现?
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function guihuan()
{
document.form.action="page1.php";
}
function baosun()
{
document.form.action="page2.php";
}
</script>
</head>
<body>
<form name="form" method="post">
<input type="text" name="name" />
<input type="submit" value="归还" onclick="guihuan()" />
<input type="submit" value="报损" onclick="baosun()" />
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function guihuan()
{
document.form.action="page1.php";
}
function baosun()
{
document.form.action="page2.php";
}
</script>
</head>
<body>
<form name="form" method="post">
<input type="text" name="name" />
<input type="submit" value="归还" onclick="guihuan()" />
<input type="submit" value="报损" onclick="baosun()" />
</form>
</body>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询