表单提交问题

ForrestWangChina1 2005-11-28 05:28:46
一个表单里有俩个以上的button,假如是button1,button2,...,我想在按button1就提交,其他的暂时不管.我该怎么做,才能让点button1提交.


还有,表单提交之后,把显示结果就在当前页的下方显示,我又该怎么做?
...全文
91 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
afei0220 2005-11-29
  • 打赏
  • 举报
回复
安全一点的话就:
<body>
<form action="cc.php" method=post name=form>
<input type='text' name='test'>
<input type='text' name='test2'>
<input type='button' onclick='document.form.submit()'>
<input type="button">
</form>
<?
if(isset$_POST['test']) { //add this to check
echo $_POST['test'];
echo $_POST['test2'];
}
?>

</body>
Zi_Yuan 2005-11-28
  • 打赏
  • 举报
回复
<body>
<form action="cc.php" method=post name=form>
<input type='text' name='test'>
<input type='button' onclick='document.form.submit()'>
<input type="button">
</form>
<?
echo $_POST['test'];
?>

</body>
Zi_Yuan 2005-11-28
  • 打赏
  • 举报
回复
<body>
<form action="cc.php" method=post name=form>
<input type='text' name='test'>
<input type='submit' onclick='document.form.submit()'>
</form>
<?
echo $_POST['test'];
?>

</body>
zalvsa 2005-11-28
  • 打赏
  • 举报
回复
<form>
<input type='text' name='test'>
<input type='button' onclick='this.form.submit()'>
</form>
<?
echo $test;
?>

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧