<html>
<head>
<title>一个表单、多个提交按钮、提交到多个不同页面</title>
</head>
<script>
function sm1(){
document.form1.action="1.php";
document.getElementByIdx("form1").submit();
}
function sm2(){
document.form1.action="2.php";
document.getElementByIdx("form1").submit();
}
</script>
<body>
<form action="" method="post" name="form1">
<input name="mytext" type="text" id="mytext" />
<input name="bt1" type="submit" id="bt1" value="提交到1.php" onclick="sm1()" />
<input name="bt2" type="submit" id="bt2" value="提交到2.php" onclick="sm2()" />
</form>
</body>
</html>
时间: 2024-10-11 13:02:31