X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Forder_pkg.js;h=1069a0ee444b48c4f037737c6668cfa5b43eacce;hb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;hp=2c13ed2544beff08e81fe2013f136efc12bdd5da;hpb=990ffbe494523af17f1a3551a020e306ad9f8d7a;p=freeside.git diff --git a/httemplate/elements/order_pkg.js b/httemplate/elements/order_pkg.js index 2c13ed254..1069a0ee4 100644 --- a/httemplate/elements/order_pkg.js +++ b/httemplate/elements/order_pkg.js @@ -1,19 +1,34 @@ -function enable_order_pkg () { +function pkg_changed () { 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; + discountnum_changed(form.discountnum); } else { form.discountnum.disabled = true; + discountnum_changed(form.discountnum); } } + + if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_start_date') == 1 ) { + form.start_date_text.disabled = false; + form.start_date.style.backgroundColor = '#ffffff'; + form.start_date_button.style.display = ''; + } else { + form.start_date_text.disabled = true; + form.start_date.style.backgroundColor = '#dddddd'; + form.start_date_button.style.display = 'none'; + } + } else { form.submitButton.disabled = true; if ( discountnum ) { form.discountnum.disabled = true; } + discountnum_changed(form.discountnum); } } @@ -26,3 +41,8 @@ function standardize_new_location() { form.submit(); } } + +function submit_abort() { + document.OrderPkgForm.submitButton.disabled = false; + nd(1); +}