diff options
-rw-r--r-- | httemplate/elements/tr-select-cust_location.html | 5 | ||||
-rw-r--r-- | httemplate/misc/order_pkg.html | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index 6de034669..49478f26a 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -145,7 +145,10 @@ Example: <TR> <<%$th%> ALIGN="right"><% $opt{'label'} || 'Service location' %></<%$th%>> <TD COLSPAN=7> - <SELECT NAME="locationnum" onChange="locationnum_changed(this);"> + <SELECT NAME = "locationnum" + ID = "locationnum" + onChange = "locationnum_changed(this);" + > <OPTION VALUE=""><% $opt{'empty_label'} || '(default service address)' |h %> % my @locations = $cust_main ? $cust_main->cust_location : (); % push @locations, $cust_location diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index b232debd7..92ec095b7 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -107,7 +107,22 @@ %> <BR> -<INPUT NAME="submitButton" TYPE="button" VALUE="Order Package" onClick = "this.disabled=true; standardize_locations();" <% $pkgpart ? '' : 'DISABLED' %>> +<INPUT NAME="submitButton" TYPE="button" VALUE="Order Package" onClick = "this.disabled=true; standardize_new_location();" <% $pkgpart ? '' : 'DISABLED' %>> + +<SCRIPT TYPE="text/javascript"> + + 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(); + } + } + +</SCRIPT> + </FORM> </BODY> |