【发布时间】:2014-01-27 06:22:14
【问题描述】:
我希望能够在不验证的情况下保存一个表单,但在提交时会进行验证。我在这个表单上有两个按钮可以保存或提交。
问题是:如果我使用“提交”按钮进行保存(然后切换控制器中的哪个操作),jquery.validate 就会启动,我无法保存部分填写的表单。
如果我将其作为链接,我不知道如何将表单发布到控制器中的新操作。
这是视图中的 HTML:
<a class="btn btn-default" data-placement="right" data-title="Save your progress." href="/Summary/Save/2" rel="tooltip"><i class="glyphicon glyphicon-floppy-disk"></i> Save Summary</a>
<a class="btn btn-default" confirm="Are you sure you want to revert to the previous saved copy? You will lose all changes since your last save." data-placement="right" data-title="Revert back to your last saved copy." href="/Summary/Revert/2" rel="tooltip"><i class="glyphicon glyphicon-remove"></i> Revert Changes</a>
<button class="btn-default btn btn-primary" confirm="This will submit the summary to the evaluator for review. No changes will be allowed unless the evaluator returns it. Are you sure?" type="submit">Submit Summary</button>
【问题讨论】:
-
暂时禁用 jQuery 验证?
-
好主意——我想办法做到这一点,发现了这个stackoverflow.com/questions/203844/…
标签: jquery asp.net-mvc forms validation jquery-validate