• Resolved hmnstd

    (@hmnstd)


    Title says it all really.

    Having accessibility issues as my label for attribute isn’t matching the id/name of my textareas.

    For example I have a textarea with the id ‘reference’ but the label for attribute is appending the form id to it eg ‘reference-36’.

    <label for="reference-36">
    
    <textarea style="height: 100px;" class="um-form-field valid not-required " name="reference" id="reference" placeholder="">

    Not so much of an issue on text inputs as they match, but both append the form id. Would prefer it if the id wasn’t present at all.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @hmnstd

    You can use this filter hook to remove your id="reference" for key reference

    /**
     * UM hook
     *
     * @type filter
     * @title um_{$key}_form_edit_field
     * @description Change field HTML on edit mode by field $key
     * @input_vars
     * [{"var":"$output","type":"string","desc":"Field HTML"},
     * {"var":"$mode","type":"string","desc":"Fields Mode"}]
     * @change_log
     * ["Since: 2.0"]
     * @usage add_filter( 'um_{$key}_form_edit_field', 'function_name', 10, 2 );
     * @example
     * <?php
     * add_filter( 'um_{$key}_form_edit_field', 'my_form_edit_field', 10, 2 );
     * function my_form_edit_field( $output, $mode ) {
     *     // your code here
     *     return $output;
     * }
     * ?>
     */

    UM source code at line 3941 in
    .../plugins/ultimate-member/includes/core/class-fields.php

    Plugin Support andrewshu

    (@andrewshu)

    Hi @hmnstd

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Registration form field – textarea id not matching label for attribute’ is closed to new replies.