Hi,
I have a local delivery service, and want to autofill the city and state for customers to avoid confusion.
This is what I have so far. The city seems to autofill and readonly the field correctly, but the state, while it turns it to readonly OK, doesn't input the value I provide. I have State dropdown disabled.
City:
Code:
<label class="inputLabel" for="city_shipping"><?php echo ENTRY_CITY; ?></label>
<?php echo zen_draw_input_field('city_shipping', 'City', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city_shipping" readonly="readonly"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' . ENTRY_CITY_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
State:
Code:
<?php
if (ACCOUNT_STATE == 'true') {
if ($flag_show_pulldown_states_shipping == true) {
?>
<label class="inputLabel" for="stateZone_shipping" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
<?php
echo zen_draw_pull_down_menu('zone_id_shipping', zen_prepare_country_zones_pull_down($selected_country_shipping), $zone_id_shipping, 'id="stateZone_shipping"');
if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert">' . ENTRY_STATE_TEXT . '</span>';
}
?>
<?php if ($flag_show_pulldown_states_shipping == true) { ?>
<br class="clearBoth" id="stBreakShipping" />
<?php } ?>
<label class="inputLabel" for="state_shipping" id="stateLabelShipping"><?php echo $state_field_label_shipping; ?></label>
<?php
echo zen_draw_input_field('state_shipping', 'State', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state_shipping" readonly="readonly"');
if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert" id="stTextShipping">' . ENTRY_STATE_TEXT . '</span>';
if ($flag_show_pulldown_states_shipping == false) {
echo zen_draw_hidden_field('zone_id_shipping', $zone_name_shipping, ' ');
}
?>
<br class="clearBoth" />
<?php
}
?>
Further, when I inspect it with Firebug, I get:
City:
Code:
<input type="text" name="city_shipping" value="City" size="33" maxlength="32" id="city_shipping" readonly="readonly">
State:
Code:
<input type="text" name="state_shipping" value="" size="33" maxlength="32" id="state_shipping" readonly="readonly">
When I copy/paste from Firebug, it shows , but when I am viewing it in Firebug, it only shows . Not sure if that makes a difference.
Any insight on why it isn't accepting my input value?
Thanks