Permalink
Browse files

a better solution to find the correct input field which holds YAPSM data

The  bug that I solved in commit '61d7b88' was not an IE9 only problem:
A third party plugin such as jQuery Placeholder might clone input fields!
  • Loading branch information...
1 parent 6dcea63 commit 5a2b79e1d9c8bf4c5d992a951b1fa2c30e2697fa @trimentor committed Sep 27, 2012
Showing with 15 additions and 3 deletions.
  1. +6 −1 app/assets/javascripts/jquery.pwdcalc.coffee
  2. +9 −2 app/assets/javascripts/jquery.pwdcalc.js
@@ -26,7 +26,12 @@ class @Pwdcalc
calculateStrength: (event) ->
$input = $('input', @$inputWrapper)
- yapsmInput = $input[$input.length-1]
+
+ yapsmInput = 'undefined'
+ for el in $input
+ if el.complexity
+ yapsmInput = el
+ break
pwd = $.trim yapsmInput.value
strength = yapsmInput.complexity

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 5a2b79e

Please sign in to comment.