<TD ALIGN="right">Census tract</TD>
<TD COLSPAN=8>
<INPUT TYPE="text" SIZE=15
- NAME="enter_censustract"
+ ID="<% $pre %>enter_censustract"
+ NAME="<% $pre %>enter_censustract"
VALUE="<% $object->censustract |h %>">
<% '(automatic)' %>
</TD>
</TR>
% }
-% if ( $conf->config('tax_district_method') ) {
-% if ( $opt{enable_district} ) {
+% if ( $opt{enable_district} and $conf->config('tax_district_method') ) {
<TR>
<TD ALIGN="right">Tax district</TD>
<TD COLSPAN=8>
<% '(automatic)' %>
</TD>
</TR>
-% } else {
+% } else {
<INPUT TYPE="hidden" ID="<%$pre%>" NAME="<%$pre%>district" VALUE="<% $object->district %>">
-% }
% }
%# For address standardization:
%# Placeholders
<INPUT TYPE="hidden" NAME="<%$pre%>cachenum" VALUE="">
<INPUT TYPE="hidden" NAME="<%$pre%>addr_clean" VALUE="">
+
+<SCRIPT TYPE="text/javascript">
+<&| /elements/onload.js &>
+ var clear_coords_ids = [
+ '<%$pre%>latitude',
+ '<%$pre%>longitude',
+ '<%$pre%>enter_censustract',
+ '<%$pre%>censustract',
+ '<%$pre%>district'
+ ];
+ function clear_coords() {
+ for (var i=0; i < clear_coords_ids.length; i++) {
+ var el = document.getElementById(clear_coords_ids[i]);
+ if ( el ) {
+ el.value = '';
+ }
+ }
+ }
+ var clear_coords_on_change = [
+ '<%$pre%>address1',
+ '<%$pre%>address2',
+ '<%$pre%>city',
+ '<%$pre%>state',
+ '<%$pre%>zip',
+ '<%$pre%>country'
+ ];
+ for (var i=0; i < clear_coords_on_change.length; i++) {
+ var el = document.getElementById(clear_coords_on_change[i]);
+ if ( el.addEventListener ) {
+ el.addEventListener('change', clear_coords);
+ } else if ( el.attachEvent ) {
+ el.attachEvent('onchange', clear_coords);
+ }
+ }
+</&>
+</SCRIPT>
+
<%init>
my %opt = @_;