Skip to content
Browse files

Password input clone is not necessarily an immediate sibling of real …

…password field (that is the case with css3pie enabled on this field). So, look for it in all siblings.
  • Loading branch information...
1 parent e8a1b12 commit 45c183c4fb4722743c8a29c90d6af315396bb837 @domi-papin committed Dec 22, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 jquery.placeholder.js
View
4 jquery.placeholder.js
@@ -62,7 +62,7 @@
var $input = $(this);
if ($input.val() === $input.attr('placeholder') && $input.hasClass('placeholder')) {
if ($input.data('placeholder-password')) {
- $input.hide().next().show().focus().attr('id', $input.removeAttr('id').data('placeholder-id'));
+ $input.hide().nextAll('input:first').show().focus().attr('id', $input.removeAttr('id').data('placeholder-id'));
} else {
$input.val('').removeClass('placeholder');
}
@@ -93,7 +93,7 @@
.data('placeholder-id', id)
.before($replacement);
}
- $input = $input.removeAttr('id').hide().prev().attr('id', id).show();
+ $input = $input.removeAttr('id').hide().prevAll('input:first').attr('id', id).show();
}
$input.addClass('placeholder').val($input.attr('placeholder'));
} else {

0 comments on commit 45c183c

Please sign in to comment.
Something went wrong with that request. Please try again.