1 function bottomfixup(what) {
4 var layervars = new Array(
6 'payinfo', 'payinfo1', 'payinfo2', 'paytype',
7 'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv',
8 'paystart_month', 'paystart_year', 'payissue',
13 var cf = document.CustomerForm;
14 var payby = cf.payby.options[cf.payby.selectedIndex].value;
15 for ( f=0; f < layervars.length; f++ ) {
16 var field = layervars[f];
17 copyelement( cf.elements[payby + '_' + field],
22 //this part does USPS address correction
23 standardize_locations();
27 <% include( '/elements/standardize_locations.js',
28 'callback', 'post_geocode();'
32 function post_geocode() {
34 % if ( $conf->exists('cust_main-require_censustract') ) {
36 //alert('fetch census tract data');
37 var cf = document.CustomerForm;
38 var state_el = cf.elements['ship_state'];
39 var census_data = new Array(
40 'year', <% $conf->config('census_year') || '2009' %>,
41 'address', cf.elements['ship_address1'].value,
42 'city', cf.elements['ship_city'].value,
43 'state', state_el.options[ state_el.selectedIndex ].value,
44 'zip', cf.elements['ship_zip'].value
47 censustract( census_data, update_censustract );
51 document.CustomerForm.submit();
57 function copyelement(from, to) {
58 if ( from == undefined ) {
60 } else if ( from.type == 'select-one' ) {
61 to.value = from.options[from.selectedIndex].value;
62 //alert(from + " (" + from.type + "): " + to.name + " => (" + from.selectedIndex + ") " + to.value);
63 } else if ( from.type == 'checkbox' ) {
65 to.value = from.value;
70 if ( from.value == undefined ) {
73 to.value = from.value;
76 //alert(from + " (" + from.type + "): " + to.name + " => " + to.value);
81 my $conf = new FS::Conf;