Jquery UI 选项卡、表单验证
我有一个 jQuery UI 选项卡式表单,例如:
<form>
<div id="tabs">
<ul>
<li>Link to fragment 1</li>
<li>Link to fragment 2</li>
<li>Link to fragment 3</span></a></li>
<li>Link to fragment 4</li>
<li>Link to fragment 5</li>
</ul>
<!-- Form Fields Step 1 -->
<div id="fragment-1" class="ui-tabs-panel">
Tab 1 Form Fields
</div>
<!-- Form Fields Step 2 -->
<div id="fragment-2" class="ui-tabs-panel ui-tabs-hide">
Tab 2 Form Fields
</div>
<!-- Form Fields Step 3 -->
<div id="fragment-3" class="ui-tabs-panel ui-tabs-hide">
Tab 3 Form Fields
</div>
<!-- Form Fields Step 4 -->
<div id="fragment-4" class="ui-tabs-panel ui-tabs-hide">
Tab 2 Form Fields
</div>
<!-- Form Fields Step 5 -->
<div id="fragment-5" class="ui-tabs-panel ui-tabs-hide">
Form Summary</div>
</div>
</form>
在提交时,我希望进行验证,将用户带到发生第一个错误的特定选项卡。任何帮助将不胜感激。 -K
I have a jQuery UI tabbed form, ex:
<form>
<div id="tabs">
<ul>
<li>Link to fragment 1</li>
<li>Link to fragment 2</li>
<li>Link to fragment 3</span></a></li>
<li>Link to fragment 4</li>
<li>Link to fragment 5</li>
</ul>
<!-- Form Fields Step 1 -->
<div id="fragment-1" class="ui-tabs-panel">
Tab 1 Form Fields
</div>
<!-- Form Fields Step 2 -->
<div id="fragment-2" class="ui-tabs-panel ui-tabs-hide">
Tab 2 Form Fields
</div>
<!-- Form Fields Step 3 -->
<div id="fragment-3" class="ui-tabs-panel ui-tabs-hide">
Tab 3 Form Fields
</div>
<!-- Form Fields Step 4 -->
<div id="fragment-4" class="ui-tabs-panel ui-tabs-hide">
Tab 2 Form Fields
</div>
<!-- Form Fields Step 5 -->
<div id="fragment-5" class="ui-tabs-panel ui-tabs-hide">
Form Summary</div>
</div>
</form>
On submit, I would like validation that takes the user to the specific tab where the first error occurs. Any help would be much appreciated. -K
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
懒惰/简单的方法是使用 JavaScript 单击包含错误的选项卡的选项卡导航。像这样的东西......
伪代码:
The lazy/easy way would be to use javascript to click the tab nav, for the tab that contains the error. Something like this...
psuedo code: