Skip to content

Commit 2f9376a

Browse files
committed
Merge pull request victorjonsson#29 from HuotMedia/master
Fixed no helper message on focus change
2 parents f4fc4f5 + 101de83 commit 2f9376a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

jquery.formvalidator.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,24 @@
4444
if(help) {
4545
$(this)
4646
.focus(function() {
47+
var $name = $(this).attr('name');
4748
var $element = $(this);
48-
if($element.parent().find('.jquery_form_help').length == 0) {
49+
if($element.parent().find('.jquery_form_help_'+$name).length == 0) {
4950
$element.after(
5051
$('<span />')
51-
.addClass('jquery_form_help')
52+
.addClass('jquery_form_help_'+$name)
5253
.text(help)
5354
.hide()
5455
.fadeIn()
5556
);
57+
}else{
58+
$element.parent().find('.jquery_form_help_'+$name).fadeIn();
5659
}
5760
})
5861
.blur(function() {
59-
$(this).parent().find('.jquery_form_help')
60-
.fadeOut('slow', function() {
61-
$(this).remove();
62-
});
62+
var $name = $(this).attr('name');
63+
$(this).parent().find('.jquery_form_help_'+$name)
64+
.fadeOut('slow');
6365
});
6466
}
6567
});
@@ -690,6 +692,7 @@ jQueryFormUtils.simpleSpamCheck = function(val, classAttr) {
690692
* @return {Boolean}
691693
*/
692694
jQueryFormUtils.validateDomain = function(val) {
695+
val = val.toLowerCase();
693696
val = val.replace('ftp://', '').replace('https://', '').replace('http://', '').replace('www.', '');
694697
var arr = new Array('.com', '.net', '.org', '.biz', '.coop', '.info', '.museum', '.name', '.pro',
695698
'.edu', '.gov', '.int', '.mil', '.ac', '.ad', '.ae', '.af', '.ag', '.ai', '.al',

0 commit comments

Comments
 (0)