我不清楚问题出在 ujs 驱动程序还是 jquery-validate 插件上...
当使用 jquery UJS 驱动程序(最新,来自 github)+ jquery-validate 插件(最新,来自 github)+ ajax 表单(通过 data-remote 标记)时,验证规则会被忽略。仅在 IE 8 中,chrome 和 FF 工作正常
使用来自 github 的最新 jquery-validation 使用 jquery 1.4.4 和 jquery 1.5.1 进行测试。
这是一个简单的例子: http ://avioing.com/validate/example.html和 http://avioing.com/validate/example_no_ujs.html
尝试提交表单,同时将 cityfield 留空。在第一种情况下什么都不会发生。您将看到在第二种情况下触发的验证消息。
这两个文件之间的唯一区别是我从后一个文件的表单中删除了“data-remote”标签,现在触发了验证。