Form Field Labels Not Showing on Frontend
-
There was another topic on this, possibly related but unclear –
https://www.ads-software.com/support/topic/field-labels-dissapear-in-edit-form/I’m developing a custom theme, standard template files, not full-site editor.
I’ve added some fields to a custom post_type for capturing contact form submissions, and I created a form using that field group for a front-end contact form.
The input fields show, but not the labels. Yes, it’s adding a “acfe-no-label” class for some unknown reason…. but it’s not even populating the label values, so removing that class still shows nothing, or shows a * without the label if it’s required field.
The form is 3 fields. Fields are showing labels in the admin panel.
Embed those fields in a form and show it on the front-end, only the input fields show, but no labels. The form actions work upon form submission, so it’s “working”, but won’t show labels.
TRIED SO FAR:
Disabling every plugin except ACF and ACFE
I’ve tried explicitly showing the field group for the front page in question.
I’ve tried disabling the form “Field groups locations rules” even though the input field are showing and processing properly.
Made sure form “Label placement” is top or left and not hidden.
Tried enabling/disabling “form element”, “honeypot”, class labels, and so on.
Tried “override form render” with value: {field:field_62ab9684119e7}
SPECULATION:
ALL form field labels are empty in the object array on the front-end. Perhaps ACFE is just adding the “acfe-no-label” class because there’s no label to show according to the empty labels in the array????Everything’s there and working properly EXCEPT the field labels?!???
All data seems to be getting loaded, EXCEPT the field labels?Strange behavior.
Here’s the field group:
Array ( [ID] => 108 [key] => group_62ab967dae8b1 [title] => Contact Form [fields] => Array ( ) [location] => Array ( [0] => Array ( [0] => Array ( [param] => post_type [operator] => == [value] => contact ) ) [1] => Array ( [0] => Array ( [param] => page [operator] => == [value] => 6 ) ) [2] => Array ( [0] => Array ( [param] => page_type [operator] => == [value] => front_page ) ) ) [menu_order] => 0 [position] => normal [style] => default [label_placement] => top [instruction_placement] => label [hide_on_screen] => [active] => 1 [description] => [show_in_rest] => 0 [acfe_display_title] => [acfe_autosync] => Array ( [0] => json ) [acfe_permissions] => [acfe_form] => 1 [acfe_meta] => [acfe_note] => [_valid] => 1 )
and the fields for that field group:
EMAIL:Array ( [ID] => 109 [key] => field_62ab9684119e7 [label] => Email [name] => email [prefix] => acf [type] => email [value] => [menu_order] => 0 [instructions] => [required] => 1 [id] => [class] => [conditional_logic] => 0 [parent] => 108 [wrapper] => Array ( [width] => [class] => [id] => ) [acfe_permissions] => [default_value] => [placeholder] => [prepend] => [append] => [show_column] => 1 [show_column_sortable] => 1 [show_column_weight] => 1000 [allow_quickedit] => 1 [allow_bulkedit] => 1 [acfe_settings] => [acfe_validate] => [_name] => email [_valid] => 1 )
SUBJECT:
Array ( [ID] => 110 [key] => field_62ab9697119e8 [label] => Subject [name] => subject [prefix] => acf [type] => text [value] => [menu_order] => 2 [instructions] => [required] => 1 [id] => [class] => [conditional_logic] => 0 [parent] => 108 [wrapper] => Array ( [width] => [class] => [id] => ) [acfe_permissions] => [default_value] => [placeholder] => [prepend] => [append] => [maxlength] => 200 [show_column] => 1 [show_column_sortable] => 1 [show_column_weight] => 1000 [allow_quickedit] => 1 [allow_bulkedit] => 1 [acfe_settings] => Array ( [62aba88d21a7d] => Array ( [acfe_settings_location] => admin [acfe_settings_settings] => Array ( [62aba89121a7e] => Array ( [acfe_settings_setting_type] => required [acfe_settings_setting_name] => [acfe_settings_setting_operator] => false [acfe_settings_setting_value] => ) [62aba89621a7f] => Array ( [acfe_settings_setting_type] => hide_field [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) [62aba89e21a80] => Array ( [acfe_settings_setting_type] => hide_label [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) [62aba8a121a81] => Array ( [acfe_settings_setting_type] => hide_instructions [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) [acfcloneindex] => Array ( [acfe_settings_setting_type] => required [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) ) ) [acfcloneindex] => Array ( [acfe_settings_location] => [acfe_settings_settings] => Array ( [acfcloneindex] => Array ( [acfe_settings_setting_type] => required [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) ) ) ) [acfe_validate] => Array ( [acfcloneindex] => Array ( [acfe_validate_location] => [acfe_validate_rules_and] => Array ( [acfcloneindex] => Array ( [acfe_validate_function] => value [acfe_validate_operator] => == [acfe_validate_match] => ) ) [acfe_validate_error] => ) ) [_name] => subject [_valid] => 1 )
MESSAGE:
Array ( [ID] => 111 [key] => field_62ab96c0119e9 [label] => Message [name] => message [prefix] => acf [type] => textarea [value] => [menu_order] => 3 [instructions] => [required] => 1 [id] => [class] => [conditional_logic] => 0 [parent] => 108 [wrapper] => Array ( [width] => [class] => [id] => ) [acfe_permissions] => [default_value] => [placeholder] => [maxlength] => 2500 [rows] => [new_lines] => [acfe_textarea_code] => 0 [show_column] => 1 [show_column_weight] => 1000 [allow_quickedit] => 1 [allow_bulkedit] => 1 [acfe_settings] => Array ( [62aba8b621a82] => Array ( [acfe_settings_location] => admin [acfe_settings_settings] => Array ( [62aba8b921a83] => Array ( [acfe_settings_setting_type] => required [acfe_settings_setting_name] => [acfe_settings_setting_operator] => false [acfe_settings_setting_value] => ) [62aba8bc21a84] => Array ( [acfe_settings_setting_type] => hide_field [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) [62aba8c021a85] => Array ( [acfe_settings_setting_type] => hide_label [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) [62aba8c321a86] => Array ( [acfe_settings_setting_type] => hide_instructions [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) [acfcloneindex] => Array ( [acfe_settings_setting_type] => required [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) ) ) [acfcloneindex] => Array ( [acfe_settings_location] => [acfe_settings_settings] => Array ( [acfcloneindex] => Array ( [acfe_settings_setting_type] => required [acfe_settings_setting_name] => [acfe_settings_setting_operator] => true [acfe_settings_setting_value] => ) ) ) ) [acfe_validate] => Array ( [acfcloneindex] => Array ( [acfe_validate_location] => [acfe_validate_rules_and] => Array ( [acfcloneindex] => Array ( [acfe_validate_function] => value [acfe_validate_operator] => == [acfe_validate_match] => ) ) [acfe_validate_error] => ) ) [_name] => message [_valid] => 1 )
And finally,
THE FORM:{ "contact_form": { "title": "Contact Form", "acfe_form_name": "contact_form", "acfe_form_field_groups": [ "group_62ab967dae8b1" ], "acfe_form_actions": [ { "acf_fc_layout": "post", "field_acfe_form_post_action_docs": null, "field_acfe_form_post_action": "insert_post", "field_acfe_form_post_custom_alias": "", "field_acfe_form_post_save_target": "current_post", "field_acfe_form_post_save_post_type": "contact", "field_acfe_form_post_map_post_type_message": null, "field_acfe_form_post_save_post_status": "pending", "field_acfe_form_post_map_post_status_message": null, "field_acfe_form_post_save_post_title": "field_62ab9697119e8", "field_acfe_form_post_map_post_title_message": null, "field_acfe_form_post_save_post_name": "generated_id", "field_acfe_form_post_map_post_name_message": null, "field_acfe_form_post_save_post_content_group": { "field_acfe_form_post_save_post_content": "field_62ab96c0119e9", "field_acfe_form_post_save_post_content_custom": "" }, "field_acfe_form_post_map_post_content_message": null, "field_acfe_form_post_save_post_excerpt_group": { "field_acfe_form_post_save_post_excerpt": "", "field_acfe_form_post_save_post_excerpt_custom": "" }, "field_acfe_form_post_map_post_excerpt_message": null, "field_acfe_form_post_save_post_author": "", "field_acfe_form_post_map_post_author_message": null, "field_acfe_form_post_save_post_parent": "", "field_acfe_form_post_map_post_parent_message": null, "field_acfe_form_post_save_post_terms": "", "field_acfe_form_post_map_post_terms_message": null, "field_acfe_form_post_save_meta": [ "field_62ab9684119e7" ], "field_acfe_form_post_load_values": "0", "field_acfe_form_post_load_source": "current_post", "field_acfe_form_post_map_post_type": false, "field_acfe_form_post_map_post_status": false, "field_acfe_form_post_map_post_title": false, "field_acfe_form_post_map_post_name": false, "field_acfe_form_post_map_post_content": false, "field_acfe_form_post_map_post_excerpt": false, "field_acfe_form_post_map_post_author": false, "field_acfe_form_post_map_post_parent": false, "field_acfe_form_post_map_post_terms": false, "field_acfe_form_post_load_meta": [] } ], "acfe_form_field_groups_rules": "1", "acfe_form_form_element": "1", "acfe_form_attributes": { "field_acfe_form_attributes_class": "acf-form", "field_acfe_form_attributes_id": "" }, "acfe_form_fields_attributes": { "field_acfe_form_fields_wrapper_class": "", "field_acfe_form_fields_class": "" }, "acfe_form_form_submit": "1", "acfe_form_submit_value": "Send Message", "acfe_form_html_submit_button": "<input type=\"submit\" class=\"acf-button button button-primary button-large p-2\" value=\"%s\" \/>", "acfe_form_html_submit_spinner": "<span class=\"acf-spinner\"><\/span>", "acfe_form_honeypot": "1", "acfe_form_kses": "1", "acfe_form_uploader": "default", "acfe_form_form_field_el": "div", "acfe_form_label_placement": "top", "acfe_form_instruction_placement": "label", "acfe_form_custom_html_enable": "0", "acfe_form_html_before_fields": "", "acfe_form_html_after_fields": "", "acfe_form_hide_error": "0", "acfe_form_hide_revalidation": "0", "acfe_form_hide_unload": "0", "acfe_form_errors_position": "above", "acfe_form_errors_class": "", "acfe_form_updated_hide_form": "1", "acfe_form_updated_message": "Your Message Has Been Sent!\r\n\r\nWe'll get back you shortly.", "acfe_form_html_updated_message": "<div id=\"message\" class=\"updated\">%s<\/div>", "acfe_form_custom_html": "{field:field_62ab9684119e7}" } }
Last, here’s the form being rendered on the front-end:
<form id="" class="acfe-form acf-form" action="" method="post" data-fields-class="" data-hide-error="0" data-hide-unload="0" data-hide-revalidation="0" data-errors-position="above" data-errors-class=""> <div id="acf-form-data" class="acf-hidden"> <input type="hidden" id="_acf_screen" name="_acf_screen" value="acfe_form"><input type="hidden" id="_acf_post_id" name="_acf_post_id" value="6"><input type="hidden" id="_acf_validation" name="_acf_validation" value="1"><input type="hidden" id="_acf_form" name="_acf_form" value="REMOVED_SENSITIVE"><input type="hidden" id="_acf_nonce" name="_acf_nonce" value="REMOVED_SENSITIVE"><input type="hidden" id="_acf_changed" name="_acf_changed" value="0"><input type="hidden" id="_acf_location[post_id]" name="_acf_location[post_id]" value="6"><input type="hidden" id="_acf_location[post_type]" name="_acf_location[post_type]" value="page"> </div> <div class="acf-fields acf-form-fields -top"><div class="acf-field acf-field-text acf-field--validate-email acfe-no-label" style="display:none !important;" data-name="_validate_email" data-type="text" data-key="_validate_email"> <div class="acf-label"> </div> <div class="acf-input"> <div class="acf-input-wrap"><input type="text" id="acf-_validate_email" name="acf[_validate_email]"></div></div> </div> <div class="acf-field acf-field-email acf-field-62ab9684119e7 is-required acfe-no-label" data-name="email" data-type="email" data-key="field_62ab9684119e7" data-required="1"> <div class="acf-label"> <label for="acf-field_62ab9684119e7"> <span class="acf-required">*</span></label></div> <div class="acf-input"> <div class="acf-input-wrap"><input type="email" id="acf-field_62ab9684119e7" name="acf[field_62ab9684119e7]" required="required"></div></div> </div> <div id="commentKey" class="acf-field acf-field-text acf-field-62accbbc29422 hidden d-none acfe-no-label" data-name="comment_key" data-type="text" data-key="field_62accbbc29422"> <div class="acf-label"> </div> <div class="acf-input"> <div class="acf-input-wrap"><input type="text" id="acf-field_62accbbc29422" name="acf[field_62accbbc29422]"></div></div> </div> <div class="acf-field acf-field-text acf-field-62ab9697119e8 is-required acfe-no-label" data-name="subject" data-type="text" data-key="field_62ab9697119e8" data-required="1"> <div class="acf-label"> <label for="acf-field_62ab9697119e8"> <span class="acf-required">*</span></label></div> <div class="acf-input"> <div class="acf-input-wrap"><input type="text" id="acf-field_62ab9697119e8" name="acf[field_62ab9697119e8]" maxlength="200" required="required"></div></div> </div> <div class="acf-field acf-field-textarea acf-field-62ab96c0119e9 is-required acfe-no-label" data-name="message" data-type="textarea" data-key="field_62ab96c0119e9" data-required="1"> <div class="acf-label"> <label for="acf-field_62ab96c0119e9"> <span class="acf-required">*</span></label></div> <div class="acf-input"> <textarea id="acf-field_62ab96c0119e9" name="acf[field_62ab96c0119e9]" rows="8" maxlength="2500" required="required"></textarea></div> </div> </div> <div class="acf-form-submit"> <input type="submit" class="acf-button button button-primary button-large p-2" value="Send Message"><span class="acf-spinner"></span> </div> </form>
- The topic ‘Form Field Labels Not Showing on Frontend’ is closed to new replies.