From 0f70b40ac5bf771034e14f75279cd0faf371c55e Mon Sep 17 00:00:00 2001
From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 9 Jun 2010 20:06:25 +0000
Subject: [PATCH] In the patron editor, ensure that the Verify Password field
 matches the Password field to validate

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16639 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/web/js/ui/default/actor/user/register.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js
index 32876b7109..31317782ec 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -742,6 +742,18 @@ function attachWidgetEvents(fmcls, fmfield, widget) {
                 );
                 return;
 
+            case 'passwd':
+                dojo.connect(widget.widget, 'onChange',
+                    function(newVal) {
+                        var pw1 = findWidget('au', 'passwd').widget;
+                        var pw2 = findWidget('au', 'passwd2').widget;
+                        var preserved_value = pw2.attr('value');
+                        // Ensure that the pw2 field match the pw1 field to validate
+                        pw2.regExp = newVal.replace(/([.\\^$*+?\(\)\[\]\{\}])/g, '\\$1');
+                        pw2.reset();
+                        ps2.attr(preserved_value);
+                    });
+                return;
         }
     }
 
-- 
2.11.0