From 3d6cd67616f792fae82f98a5a10f0a1a1ef678bb Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 12 May 2014 18:20:15 +0200 Subject: [PATCH] Focus password field after changing type --- js/libs/jquery.psswrd.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/libs/jquery.psswrd.js b/js/libs/jquery.psswrd.js index da30bed..9f87b66 100755 --- a/js/libs/jquery.psswrd.js +++ b/js/libs/jquery.psswrd.js @@ -6,7 +6,10 @@ var $input = $(this); var $checkbox = $($input.data('typetoggle')); - $checkbox.change(updateType); + $checkbox.change(function() { + updateType(); + $input.focus(); + }); updateType(); function updateType() { $input[0].type = $checkbox.is(':checked') ? 'text' : 'password';