【发布时间】:2014-01-22 00:49:47
【问题描述】:
我想用<button> 而不是<input> 提交表单。
我知道 <button> 不能像提交 <input> 那样处理表单,我必须使用 onclick 方法。
我尝试了几件事,但它不起作用
<button name="<?php echo $name; ?>" onclick="document.<?php echo $this->action; ?>.submit()"> ... ( Action URL of the form )
<button name="<?php echo $name; ?>" onclick="document.iso<?php echo rand(); ?>.submit()">... ( name of the form )
<button name="<?php echo $name; ?>" onclick="window.location.href='<?php echo $this->action; ?>'">... ( Action url of the form )
有人知道答案吗?
【问题讨论】:
-
生成的表单名称是什么?
-
您想在 Click 事件中提交表单?
-
“我知道
-
-This- 可能有用
-
表单内的按钮可以在没有任何onclick事件的情况下提交表单
标签: javascript php jquery html forms