Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Password input clone is not necessarily an immediate sibling of real pas... #44

Closed
wants to merge 1 commit into from

3 participants

@domi-papin

...sword field (that is the case with css3pie enabled on this field). So, look for it in all siblings.

@domi-papin domi-papin 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.
45c183c
@mathiasbynens

Can haz test case? How exactly does CSS3Pie interfere with the cloned element that this plugin adds?

@domi-papin
@fredr fredr referenced this pull request from a commit in fredr/jquery-placeholder
@fredr fredr Changed the input replacement functionality for password inputs to re…
…place the input inplace instead of using dummy inputs. Fixes many password related issues like #44 and #65. And solves a problem when working with jquery.validator where it will trigger for the hidden dummy element if i.e maxlength attribute is set on the input.
6e3d7bc
@amerikan
Collaborator

I've merge #230 which is almost identical to this.

@amerikan amerikan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 22, 2011
  1. @domi-papin

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

    domi-papin authored
    …password field (that is the case with css3pie enabled on this field). So, look for it in all siblings.
This page is out of date. Refresh to see the latest.
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 {
Something went wrong with that request. Please try again.