summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2010-03-19 21:54:02 +0000
committermark <mark>2010-03-19 21:54:02 +0000
commitf08d84b58dc43d79972590baf876ba5486179773 (patch)
tree3aa357279b39f0f28364eeced1773ed847fa0df2
parentc4991a99f2aa934b24b6c4d635af28ec5450c410 (diff)
RT#7812: confirm before closing quick payment entry
-rw-r--r--httemplate/misc/batch-cust_pay.html15
1 files changed, 14 insertions, 1 deletions
diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
index e10a5f658..505f2d0ff 100644
--- a/httemplate/misc/batch-cust_pay.html
+++ b/httemplate/misc/batch-cust_pay.html
@@ -2,7 +2,20 @@
<% include('/elements/error.html') %>
-<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.submit.disabled=true;">
+<SCRIPT TYPE="text/javascript">
+function warnUnload() {
+ if(document.getElementById("OneTrueTable").rows.length > 3 &&
+ !document.OneTrueForm.submit.disabled) {
+ return "The current batch will be lost.";
+ }
+ else {
+ return null;
+ }
+}
+window.onbeforeunload = warnUnload;
+</SCRIPT>
+
+<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.submit.disabled=true;window.onbeforeunload = null;">
<!-- <B>Batch</B> <INPUT TYPE="text" NAME="paybatch"><BR><BR> -->