[Koha-cvs] koha/koha-tmpl/intranet-tmpl/npl/en includes/co... [dev_week]
Owen Leonard
oleonard at athenscounty.lib.oh.us
Thu Apr 19 19:00:17 CEST 2007
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Owen Leonard <oleonard> 07/04/19 17:00:17
Modified files:
koha-tmpl/intranet-tmpl/npl/en/includes: common.js.inc
koha-tmpl/intranet-tmpl/npl/en: request.tmpl
Log message:
Adding a "prevent duplicates" function to replace inline javascript on the request page designed to prevent duplicate submissions. Previous version wasn't working in Opera. This version also includes a check for a card number before submitting.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/includes/common.js.inc?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.1.2.5&r2=1.1.2.1.2.6
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/request.tmpl?cvsroot=koha&only_with_tag=dev_week&r1=1.3.2.2.2.1&r2=1.3.2.2.2.2
Patches:
Index: includes/common.js.inc
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/includes/Attic/common.js.inc,v
retrieving revision 1.1.2.1.2.5
retrieving revision 1.1.2.1.2.6
diff -u -b -r1.1.2.1.2.5 -r1.1.2.1.2.6
--- includes/common.js.inc 1 Dec 2006 14:52:35 -0000 1.1.2.1.2.5
+++ includes/common.js.inc 19 Apr 2007 17:00:17 -0000 1.1.2.1.2.6
@@ -100,8 +100,28 @@
}
}
+function preventDupe(){
+ if(!document.getElementById) return false;
+ if(!document.getElementById('requestForm')) return false;
+
+ rq = document.getElementById('requestForm');
+ rq.onsubmit = function() {
+ if(rq.member.value == ''){
+ alert('Please enter a library card number!')
+ return false;
+ }
+ if(!document.getElementById('requestSubmit')) return false;
+ control = document.getElementById('requestSubmit');
+ control.value='Please please wait...';
+ control.disabled=true;
+ return true;
+ }
+
+}
+
addLoadEvent(verifyAmazonImages);
addLoadEvent(mainfocus);
addLoadEvent(preparehelp);
+ addLoadEvent(preventDupe);
//]]>
</script>
\ No newline at end of file
Index: request.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/Attic/request.tmpl,v
retrieving revision 1.3.2.2.2.1
retrieving revision 1.3.2.2.2.2
diff -u -b -r1.3.2.2.2.1 -r1.3.2.2.2.2
--- request.tmpl 19 Sep 2006 13:22:11 -0000 1.3.2.2.2.1
+++ request.tmpl 19 Apr 2007 17:00:17 -0000 1.3.2.2.2.2
@@ -2,7 +2,7 @@
<!-- TMPL_INCLUDE NAME="masthead.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-nav.inc" -->
<div id="main">
-<form action="placerequest.pl" method="post" id="mainform">
+<form action="placerequest.pl" method="post" id="requestForm">
<input type="hidden" name="biblio" value="<!-- TMPL_VAR Name="bib" -->" />
<input type="hidden" name="type" value="str8" />
@@ -69,7 +69,7 @@
<!-- /TMPL_LOOP -->
</table></div>
-<input type="submit" name="submit" value="Place New Request" class="submit" onclick="this.value='Please wait...'; this.disabled=true;" />
+<input type="submit" name="submit" value="Place New Request" id="requestSubmit" class="submit" />
</form>
<!-- TMPL_IF NAME="reserveloop" -->
<form name="T<!-- TMPL_VAR Name="time" -->" action="modrequest.pl" method="post">
More information about the Koha-cvs
mailing list