KMAIN-1830 Backspace clears on barcode only
authorBill Erickson <berickxx@gmail.com>
Mon, 2 May 2016 15:57:14 +0000 (11:57 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Only apply backspace-clears-barcode handling to the barcode input.  As
it was, it was defaulting to all text inputs (e.g. stat cat values).

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

index 62a4a2a..6601745 100644 (file)
@@ -1611,7 +1611,7 @@ function attachWidgetEvents(fmcls, fmfield, widget) {
             // when creating a new patron, a backspace in the barcode
             // entry field clears the barcode and username values.
             if (patron.isnew()) {
-                dojo.connect(dojo.byId("barcode"), "onkeypress", 
+                dojo.connect(widget.widget, "onKeyPress", 
                     function(event) {
                         if (event.keyCode != 8) return // 8 = Backspace Key
                         findWidget('au', 'usrname').widget.attr('value', '');