MonoRail:如何删除原型验证?
我正在维护一个单轨应用程序,我们决定更改 Jquery 应用程序的验证方法。到目前为止一切都很好,但是......我遇到的问题是我无法摆脱对先前原型验证方法的引用。
事实是,Javascript 总是放置在我创建的标签表单之后。
<script type="text/javascript">
if (!window.prototypeValidators) prototypeValidators = $A([]);
var validator = new Validation('form1', {onSubmit:true, focusOnError:true, stopOnFirst:false, immediate:true, useTitles:true});
prototypeValidators['form1'] = validator;
</script>
我无法找到有关单轨验证方法的明确文档。
这会在浏览器上产生一些错误,如下所示:
$A is not defined
[Break On This Error] if (!window.prototypeValidators) prototypeValidators = $A([]);
任何以正确方式提供有关此问题的文档或如何从单轨列车中删除此类验证的帮助或指针,将不胜感激。
预先感谢
MetalGeorge
PS。我得说我对单轨列车相当陌生
I'm maintaining an application with monorail, and we decided to change the validation method for the Jquery one. So far so good, but... the problem i'm having is that i can't get rid of the reference to the previous validation method which is prototype.
Thing is that a Javascript is always placed after the tag forms i create.
<script type="text/javascript">
if (!window.prototypeValidators) prototypeValidators = $A([]);
var validator = new Validation('form1', {onSubmit:true, focusOnError:true, stopOnFirst:false, immediate:true, useTitles:true});
prototypeValidators['form1'] = validator;
</script>
I haven't been able to find clear documentation about monorail validation methods.
And this turns to produce some errors on the browser like so:
$A is not defined
[Break On This Error] if (!window.prototypeValidators) prototypeValidators = $A([]);
Any help or pointers in the right way for documentation about this or how to remove this kind of validation from monorail, will be greatly appreciated.
Thanks in advance
MetalGeorge
PS. i gotta say i'm fairly new to monorail
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用单轨配置中的 JSGeneratorConfiguration 属性切换到 jQuery 生成(如您所述,默认为 Prototype)。请参阅 http://hammett.castleproject.org/?p=238 以供参考。
来完全摆脱表单验证生成:
或者,您可以通过将:替换为常规表单标签
You can switch to jQuery generation (default is Prototype as you noted) with the JSGeneratorConfiguration property in the Monorail config. See http://hammett.castleproject.org/?p=238 for reference.
Or you can get rid of form validation generation completely by replacing:
with a regular form tag: