Backspace Now Completely Clears Barcode Field When Doing A
Patron Registration.
Signed-off-by: Nick Duncan <nDuncan@catalystitservices.com>
Modified by Bill E. for style, to avoid unnecessary dojo.attach, and
to add some comments.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
);
}
);
+
+ // 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",
+ function(event) {
+ if (event.keyCode != 8) return // 8 = Backspace Key
+ findWidget('au', 'usrname').widget.attr('value', '');
+ findWidget('ac', 'barcode').widget.attr('value', '');
+ findWidget('ac', 'barcode').widget.attr('required', true);
+ }
+ );
+ }
+
return;
}
}