我使用的标题jQuery验证插件和存储的错误信息,如:不显示输入元素上悬停时的标题文本
<input type="text" name="email" class="required email" title="Bad email format" />
我不希望标题文本“坏电子邮件格式”来在悬停时显示。如何禁用此功能(如果可能的话)?
我使用的标题jQuery验证插件和存储的错误信息,如:不显示输入元素上悬停时的标题文本
<input type="text" name="email" class="required email" title="Bad email format" />
我不希望标题文本“坏电子邮件格式”来在悬停时显示。如何禁用此功能(如果可能的话)?
尝试使用rel="Bad email format"
insted的标题或HTML数据属性,如data-errorMssg="Bad email format"
如果你不能在这里使用它们是一个提取的代码隐藏标题
(function($){
$.fn.hide_my_tooltips = function() {
return this.each(function() {
$(this).hover(function(e) {
// mouseover
var $this=$(this);
$this.data("myTitle",$this.attr("title")); //store title
$this.attr("title","");
}, function() {
// mouseout
var $this=$(this);
$this.attr("title",$this.data("myTitle")); //add back title
});
$(this).click(function() {
var $this=$(this);
$this.attr("title",$this.data("myTitle")); //add back title
});
});
};
})(jQuery);
//在文件准备函数调用正确的选择的JQ功能。 $(“input”)。hide_my_tooltips();
您需要在其他地方存储错误消息。例如,在JavaScript数组中:
var errors = { "emailformat" : "Bad email format" }
并随时随地处理它,从数组中调用它而不是从html中调用它。
你能指定我可以如何使用jQuery验证插件吗?我是否必须为每个输入元素添加特殊规则? – 2012-03-31 13:08:54
谢谢,这个函数正在工作,“rel”和“data-Msg”不起作用 – 2012-03-31 13:18:12