如何用jQuery验证引擎和Twitter Bootstrap模块修复定位错误 [英] How to fix positioning error with jQuery Validation Engine and Twitter Bootstrap modals
问题描述
我在我的网站上使用了Twitter Bootstrap 2.1.0,我也使用了jQuery Validation Engine 2.6.2插件,这些插件可以很好地协同工作。
直到您尝试在模式中使用验证引擎:
注意我们如何获得一个水平滚动条,并且信息被截断了?
我是想知道我能做些什么来解决这个问题?解决方案
您可以在实例化/更新validationEngine时为错误消息建立一个默认位置,这将适用于所有验证字段:
$(#formID1)。validationEngine({promptPosition:topRight: -100\" });
和/或为每个字段设置单独的位置设置:
< input type =textclass =validate [required]data-prompt-position =bottomRight:-100/>
I am using Twitter Bootstrap 2.1.0 on my site, I am also using the jQuery Validation Engine 2.6.2 plugin, which these work well together.
Until you try to use the validation engine in a modal:
Notice how we get a horizontal scroll bar, and the message gets cut off?
I am wondering what I can do to fix this?
You can establish a default position for the error messages when you instantiate/update validationEngine, which will apply to all your validated fields:
$("#formID1").validationEngine({promptPosition : "topRight:-100"});
and/or setup individual position settings for each of your fields:
<input type="text" class="validate[required]" data-prompt-position="bottomRight:-100" />
这篇关于如何用jQuery验证引擎和Twitter Bootstrap模块修复定位错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!