Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipping Estimator: mismatched label for with field id. #5943

Open
torvista opened this issue Aug 18, 2023 · 0 comments
Open

Shipping Estimator: mismatched label for with field id. #5943

torvista opened this issue Aug 18, 2023 · 0 comments

Comments

@torvista
Copy link
Member

The label of the state field is always for="stateZone".
If the field is an input field, it's id="state". So the for of the label, does not match.
If the field is a dropdown field, it's id="stateZone". So the for of the label, does match.

The code may suggest these two instances be completely separated or merged, as they seem to be neither one nor the other at the moment:

<label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
<?php
if ($flag_show_pulldown_states) {
?>
<?php echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $state_zone_id, 'id="stateZone"');?>
<br class="clearBoth" id="stBreak">
<?php
}
?>
<label class="inputLabel" for="state" id="stateLabel"><?php echo (isset($state_field_label) ? $state_field_label : ''); ?></label>
<?php echo zen_draw_input_field('state', $selectedState, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"') .'&nbsp;<span class="alert" id="stText">&nbsp;</span>'; ?>
<br class="clearBoth">

But, adding in the javascript that hides some of these items, makes this not so trivial.

Previously this has reared related ugly heads:
#4858
#4792

Perhaps this indicates it could do with an attempt at simplification...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant