RT# 75357 - v3 fix for creating contact rows in prospects
[freeside.git] / httemplate / elements / tr-select-cust_location.html
index abaaa5b..028c8b9 100644 (file)
@@ -224,9 +224,22 @@ Example:
              'enable_censustract' => 1,
           )
 %>
+
 <SCRIPT TYPE="text/javascript">
-  locationnum_changed(document.getElementById('locationnum'));
+% if ( $prospect_main ) { # && ! $opt{is_optional} ) {
+
+    changeSelect(document.getElementById('country'), <% $cust_location->country || $countrydefault |js_string %>);
+
+    country_changed( document.getElementById('country'),
+                     fix_state_factory( <% $cust_location->state || $statedefault |js_string %>,
+                                        ''
+                                      )
+                   );
+% } else {
+    locationnum_changed(document.getElementById('locationnum'));
+% }
 </SCRIPT>
+
 <%init>
 
 my $conf = new FS::Conf;