【发布时间】:2013-04-20 22:44:33
【问题描述】:
作为标题,我在尝试在表单中使用 button 元素时遇到了一些问题,这正是 MyBB 表单。
比如我们要新建一个线程对吧?
所以我们有这些:
- newthread.php(MyBB 根目录)
- newthread 模板(在 MyBB admincp 内)
表单将如下所示
<form action="newthread.php?tid=XX">
...
<button type="submit" name="submit">Post Thread</button>
<button type="submit" name="previewpost">Preview Post</button>
...
</form>
你会知道接下来会发生什么,当我们点击预览帖子按钮时,它会提交表单。我更改了 type="submit" => type="button" 但我不知道如何让表单知道我想预览帖子。
对此有什么帮助吗?
【问题讨论】:
-
你是用jQuery还是原生JS?
-
MyBB 使用原型。但我正在使用 jQuery。