1 function pkg_changed () {
2 var form = document.OrderPkgForm;
3 var discountnum = form.discountnum;
5 if ( form.pkgpart.selectedIndex > 0 ) {
7 var opt = form.pkgpart.options[form.pkgpart.selectedIndex];
8 var date_button = document.getElementById('start_date_button');
9 var date_button_disabled = document.getElementById('start_date_button_disabled');
10 var date_text = document.getElementById('start_date_text');
13 form.submitButton.disabled = false;
15 if ( opt.getAttribute('data-can_discount') == 1 ) {
16 form.discountnum.disabled = false;
17 discountnum_changed(form.discountnum);
19 form.discountnum.disabled = true;
20 discountnum_changed(form.discountnum);
24 // if this form element exists, then the start date is a future
25 // package change date; don't replace it
29 form.start_date_text.value = opt.getAttribute('data-start_date');
30 if ( opt.getAttribute('data-can_start_date') == 1 ) {
31 date_text.style.backgroundColor = '#ffffff';
32 date_text.disabled = false;
33 date_button.style.display = '';
34 date_button_disabled.style.display = 'none';
36 date_text.style.backgroundColor = '#dddddd';
37 date_text.disabled = true;
38 date_button.style.display = 'none';
39 date_button_disabled.style.display = '';
43 form.submitButton.disabled = true;
44 if ( discountnum ) { form.discountnum.disabled = true; }
45 discountnum_changed(form.discountnum);
49 function standardize_new_location() {
50 var form = document.OrderPkgForm;
51 var loc = form.locationnum;
52 if (loc.type == 'select-one' && loc.options[loc.selectedIndex].value == -1){
53 standardize_locations();
59 function submit_abort() {
60 document.OrderPkgForm.submitButton.disabled = false;