解决点击操作按钮冲突的可能方法

Possible way to resolve conflict on click action button

我在按钮上使用 bootstrap 库:

<input type="submit" onclick="$(this).button('loading')" name="submit" data-loading-text="Loading..." class="btn btn-primary"/>

this JsFiddle会描述我的问题。

但是我想同时执行这两个事件。 两个事件:1. 文本区域验证 & 2. 按钮加载状态

P.S。按下按钮后,我的页面会重新加载,因此没有必要包含按钮状态 'reset'

在此先感谢您的帮助

终于得到解决方案:

要么你可以在表单提交事件上应用加载状态 <form method="post" action="" onsubmit="$(this).find('.btn-primary').button('loading')">,像这样 jSFiddle

或者你也可以用这个JsFiddle