From: ivan Date: Mon, 11 Apr 2011 23:06:23 +0000 (+0000) Subject: fix usps-validation misfire and inability to submit on change package too, RT#12377... X-Git-Tag: freeside_2_1_3~311 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=bf97863715c17358d674593b0cd3c217e1811530;p=freeside.git fix usps-validation misfire and inability to submit on change package too, RT#12377, RT#12183 --- diff --git a/httemplate/elements/order_pkg.js b/httemplate/elements/order_pkg.js new file mode 100644 index 000000000..2c13ed254 --- /dev/null +++ b/httemplate/elements/order_pkg.js @@ -0,0 +1,28 @@ +function enable_order_pkg () { + var form = document.OrderPkgForm; + var discountnum = form.discountnum; + + if ( form.pkgpart.selectedIndex > 0 ) { + form.submitButton.disabled = false; + if ( discountnum ) { + if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) { + form.discountnum.disabled = false; + } else { + form.discountnum.disabled = true; + } + } + } else { + form.submitButton.disabled = true; + if ( discountnum ) { form.discountnum.disabled = true; } + } +} + +function standardize_new_location() { + var form = document.OrderPkgForm; + var loc = form.locationnum; + if (loc.type == 'select-one' && loc.options[loc.selectedIndex].value == -1){ + standardize_locations(); + } else { + form.submit(); + } +} diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index ec10b85cf..8f0067d2d 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -1,5 +1,7 @@ <% include('/elements/header-popup.html', "Change Package") %> + + <% include('/elements/error.html') %>
@@ -40,7 +42,12 @@ %>
- +param('pkgpart')) ? '' : 'DISABLED' %> +>
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 57f1f3b9b..a391f8c1d 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -5,33 +5,7 @@ - + <% include('/elements/error.html') %> @@ -117,7 +91,12 @@ %>
-> + +>