bob*_*ech 3 html javascript php forms jquery
我想提交一份表格<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 )
Run Code Online (Sandbox Code Playgroud)
有人知道答案吗?
Aru*_*hny 11
您可以使用按钮的type="submit"like属性
<button type="submit" name="<?php echo $name; ?>">Submit</button>
Run Code Online (Sandbox Code Playgroud)