diff options
author | ivan <ivan> | 2011-04-11 23:06:16 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-04-11 23:06:16 +0000 |
commit | 990ffbe494523af17f1a3551a020e306ad9f8d7a (patch) | |
tree | 68da8ca62b98610b45bacc3b5f66ae4aa46f7430 /httemplate/elements | |
parent | 2579dce95f2a41d7a162404f193545e9601c374d (diff) |
fix usps-validation misfire and inability to submit on change package too, RT#12377, RT#12183
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/order_pkg.js | 28 |
1 files changed, 28 insertions, 0 deletions
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(); + } +} |