JBAS-1665 Field validation CSS repair
authorBill Erickson <berickxx@gmail.com>
Mon, 30 Jan 2017 15:21:16 +0000 (10:21 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Use jquery to set/remove classes during field validation tests to ensure
other classes on the elements are not accidentally removed.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/opac/register.js

index 87cfb3a..2d9f189 100644 (file)
@@ -183,7 +183,11 @@ function validate(dom_id) {
     }
 
     if (element) {
-        element.className = valid ? '' : 'patron-reg-invalid';
+        if (valid) {
+            $(element).removeClass('patron-reg-invalid');
+        } else {
+            $(element).addClass('patron-reg-invalid');
+        }
     }
 }