diff options
Diffstat (limited to 'httemplate/view/cust_main/quick-charge.html')
-rw-r--r-- | httemplate/view/cust_main/quick-charge.html | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/httemplate/view/cust_main/quick-charge.html b/httemplate/view/cust_main/quick-charge.html deleted file mode 100644 index 06ffd75e6..000000000 --- a/httemplate/view/cust_main/quick-charge.html +++ /dev/null @@ -1,73 +0,0 @@ -<SCRIPT TYPE="text/javascript"> - -function enable_quick_charge () { - //alert('enable_quick_charge ' + document.QuickChargeForm.amount.value + ' - ' + document.QuickChargeForm.pkg.value ); - if ( document.QuickChargeForm.amount.value - && document.QuickChargeForm.pkg.value ) { - document.QuickChargeForm.submit.disabled = false; - } else { - document.QuickChargeForm.submit.disabled = true; - } -} - -function enable_quick_charge_desc () { - //alert('enable_quick_charge ' + document.QuickChargeForm.amount.value + ' - ' + document.QuickChargeForm.pkg.value ); - if ( document.QuickChargeForm.amount.value ) { - document.QuickChargeForm.submit.disabled = false; - } else { - document.QuickChargeForm.submit.disabled = true; - } -} - -function enable_quick_charge_amount () { - //alert('enable_quick_charge ' + document.QuickChargeForm.amount.value + ' - ' + document.QuickChargeForm.pkg.value ); - if ( document.QuickChargeForm.pkg.value ) { - document.QuickChargeForm.submit.disabled = false; - } else { - document.QuickChargeForm.submit.disabled = true; - } -} - -function validate_quick_charge () { - //alert('validate_quick_charge'); - var pkg = document.QuickChargeForm.pkg.value; - var pkg_regex = /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]+)$/ ; - var amount = document.QuickChargeForm.amount.value; - var amount_regex = /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ; - - if ( amount_regex.test(amount) && pkg_regex.test(pkg) ) { - return true; - } else if ( amount_regex.test(amount) ) { - if ( pkg ) { - alert('Illegal description - spaces, letters, numbers, and the following punctuation characters are allowed: . , ! ? @ # $ % & ( ) - + ; : ' + "'" + ' " = [ ]' ); - } else { - alert('Enter a description for the one-time charge'); - } - return false; - } else { - alert('Illegal amount - enter an amount to charge, for example, "5" or "43" or "21.46".'); - return false; - } -} - -</SCRIPT> - -<FORM NAME="QuickChargeForm" ACTION="<%$p%>edit/process/quick-charge.cgi" METHOD="POST" onSubmit="return validate_quick_charge()"> - -<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>"> - -Description:<INPUT TYPE="text" NAME="pkg" onChange="enable_quick_charge()" onKeyPress="enable_quick_charge_desc()"> - -Amount:<INPUT TYPE="text" NAME="amount" SIZE=6 onChange="enable_quick_charge()" onKeyPress="enable_quick_charge_amount()"> - -<% include('/elements/select-taxclass.html') %> - -<INPUT NAME="submit" TYPE="submit" VALUE="One-time charge" DISABLED> - -</FORM> - -<%init> - -my( $cust_main ) = @_; - -</%init> |