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_disabled');
10 var date_text = document.getElementById('start_date_text');
12 var radio_now = document.getElementById('start_now');
13 //var radio_on_hold = document.getElementById('start_on_hold');
14 var radio_on_date = document.getElementById('start_on_date');
16 form.submitButton.disabled = false;
18 if ( opt.getAttribute('data-can_discount') == 1 ) {
19 form.discountnum.disabled = false;
20 discountnum_changed(form.discountnum);
22 form.discountnum.disabled = true;
23 discountnum_changed(form.discountnum);
27 // if this form element exists, then the start date is a future
28 // package change date; don't replace it
32 form.start_date_text.value = opt.getAttribute('data-start_date');
33 if ( opt.getAttribute('data-can_start_date') == 1 ) {
34 date_text.style.backgroundColor = '#ffffff';
35 date_text.disabled = false;
36 date_button.style.display = '';
37 date_button_disabled.style.display = 'none';
38 if ( radio_on_date ) {
39 radio_on_date.disabled = false;
40 if ( form.start_date_text.value.length > 0 && radio_now.checked ) {
41 radio_now.checked = false;
42 radio_on_date.checked = true;
46 date_text.style.backgroundColor = '#dddddd';
47 date_text.disabled = true;
48 date_button.style.display = 'none';
49 date_button_disabled.style.display = '';
50 if ( radio_on_date ) {
51 if ( radio_on_date.checked ) {
52 radio_on_date.checked = false;
53 radio_now.checked = true;
55 radio_on_date.disabled = true;
60 form.submitButton.disabled = true;
61 if ( discountnum ) { form.discountnum.disabled = true; }
62 discountnum_changed(form.discountnum);
66 function standardize_new_location() {
67 var form = document.OrderPkgForm;
68 var loc = form.locationnum;
69 if (loc.type == 'select-one' && loc.options[loc.selectedIndex].value == -1){
70 standardize_locations();
76 function submit_abort() {
77 document.OrderPkgForm.submitButton.disabled = false;