使用 Parsley.js,是否可以指定应该保存错误消息的元素?我试过了:
Using Parsley.js, is it possible to specify the element that should hold the error messages? I tried:
$('#myForm').parsley({
errors: {
container: {
$('#errorMessages')
}
}
});
但错误消息仍然放在我的表单输入之后.
But the error messages are still placed right after my form inputs.
我添加了另一个数据属性,data-parsley-errors-container="#element".这可以让您修改 DOM 以指定错误消息的显示位置.
I've added another data-attribute, data-parsley-errors-container="#element".
That could allow you modify the DOM to specify where the error messages will be displayed.
更多信息:http://parsleyjs.org/doc/index.html#ui-for-field
最好的
这篇关于Parsley.js - 在指定元素中显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
用于创建头像的 jQuery/JavaScript 库?jQuery/JavaScript Library for avatar creation?(用于创建头像的 jQuery/JavaScript 库?)
如何做以下掩码输入问题?How to do following mask input problem?(如何做以下掩码输入问题?)
使用 DropKick Javascript 设置值/标签的问题Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 设置值/标签的问题)
如何对 jquery 插件中的私有方法进行单元测试?how to unit-test private methods in jquery plugins?(如何对 jquery 插件中的私有方法进行单元测试?)
stellar.js - 为垂直滚动网站配置偏移量/对齐元素stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 为垂直滚动网站配置偏移量/对齐元素?)
jQuery 屏蔽输入插件.当文本框获得焦点时选择所有jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽输入插件.当文本框获得焦点时选择所有内容)