From: jeff Date: Fri, 29 May 2009 00:22:48 +0000 (+0000) Subject: don't require a leading 0 in the quick charge amount X-Git-Tag: freeside_1_9_1^2~388 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=7e368366b4b1c3b6a2b1990f34d79a15289cadcc;p=freeside.git don't require a leading 0 in the quick charge amount --- diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 8fa57ddea..470cd4b5b 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -27,7 +27,7 @@ $param->{"custnum"} =~ /^(\d+)$/ or $error .= "Illegal customer number " . $param->{"custnum"} . " "; my $custnum = $1; -$param->{"amount"} =~ /^\s*(\d+(\.\d{1,2})?)\s*$/ +$param->{"amount"} =~ /^\s*(\d*(?:\.?\d{1,2}))\s*$/ or $error .= "Illegal amount " . $param->{"amount"} . " "; my $amount = $1; diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index c18b2bc64..8aca34a0d 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -20,7 +20,7 @@ function 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*$/ ; + var amount_regex = /^\s*\$?\s*(\d*(\.?\d{1,2}))\s*$/ ; var rval = true; if ( ! amount_regex.test(amount) ) {