[open-ils-commits] r16324 - branches/rel_1_6/Open-ILS/web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 27 16:32:04 EDT 2010
Author: dbs
Date: 2010-04-27 16:31:59 -0400 (Tue, 27 Apr 2010)
New Revision: 16324
Modified:
branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js
Log:
Improve password reset form usability
Clean up after ourselves by clearing the values of the barcode / username
text fields if the user hits Cancel or submits a request that was handled
by the backend service.
Modified: branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js 2010-04-27 20:31:05 UTC (rev 16323)
+++ branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js 2010-04-27 20:31:59 UTC (rev 16324)
@@ -15,12 +15,14 @@
// Connect the buttons to submit / cancel events that override
// the default actions associated with the buttons to do
// pleasing Ajax things
- dojo.connect(dijit.byId("cancelButton"), "onClick", function(event) {
+ dojo.connect(dijit.byId("pwCancel"), "onClick", function(event) {
event.preventDefault();
event.stopPropagation();
pwResetFormDlg.hide();
+ dijit.byId('pwUsername').attr('value', null);
+ dijit.byId('pwBarcode').attr('value', null);
});
- dojo.connect(dijit.byId("submitButton"), "onClick", function(event) {
+ dojo.connect(dijit.byId("pwSubmit"), "onClick", function(event) {
event.preventDefault();
event.stopPropagation();
var xhrArgs = {
@@ -29,6 +31,8 @@
load: function(data) {
pwResetFormDlg.hide();
passwordSubmission(opac_strings.PWD_RESET_SUBMIT_SUCCESS);
+ dijit.byId('pwUsername').attr('value', null);
+ dijit.byId('pwBarcode').attr('value', null);
},
error: function(error) {
pwResetFormDlg.hide();
@@ -79,6 +83,7 @@
dojo.attr(pwResetFormCell, { innerHTML: opac_strings.BARCODE_PROMPT });
pwResetFormCell = dojo.create("td", null, pwResetFormRow);
var barcodeText = new dijit.form.TextBox({
+ id: "pwBarcode",
name: "barcode"
}).placeAt(pwResetFormCell);
pwResetFormRow = dojo.create("tr", {}, pwResetFormTbody);
@@ -86,16 +91,17 @@
dojo.attr(pwResetFormCell, { innerHTML: opac_strings.USERNAME_PROMPT });
pwResetFormCell = dojo.create("td", {}, pwResetFormRow);
var usernameText = new dijit.form.TextBox({
+ id: "pwUsername",
name: "username"
}).placeAt(pwResetFormCell);
dojo.create("br", null, pwResetFormDiv);
var submitButton = new dijit.form.Button({
- id: "submitButton",
+ id: "pwSubmit",
type: "submit",
label: opac_strings.SUBMIT_BUTTON_LABEL
}).placeAt(pwResetFormDiv);
var cancelButton = new dijit.form.Button({
- id: "cancelButton",
+ id: "pwCancel",
type: "cancel",
label: opac_strings.CANCEL_BUTTON_LABEL
}).placeAt(pwResetFormDiv);
More information about the open-ils-commits
mailing list