- fieldset.find('input').on('change', this, location_changed);
- fieldset.find('select').on('change', this, location_changed);
+ // event handler; the Location object is passed in event.data
+ var location_changed = standardize_if_ready;
+
+ // bind only to the fields that are used in standardization
+ // (so that it's possible to manually edit coords, etc.)
+ var onchange_fields =
+ [ 'address1', 'address2', 'city', 'state', 'zip', 'country' ];
+ for ( var i = 0; i < onchange_fields.length; i++ ) {
+ $('#' + prefix + onchange_fields[i]).on('change', this, location_changed);
+ }