laravel 带有select和options的AIRA输入字段名称用法不正确

juzqafwq  于 2023-11-20  发布在  其他
关注(0)|答案(1)|浏览(79)

你好,我不知道如何管理这些字段来解决问题ARIA输入字段没有可访问的名称。当我测试网站,它显示我这些领域。任何建议?

<div class="form-group col-lg-3 col-md-6 col-sm-12">
                            <select class="custom-select-box select2 " name="mainCatID"  id="category">
                                <option value="">@lang('language.HEADING_SELECT_CATEGORY')</option>
                                @foreach ($RecipeMainCategory as $val)
                                <option value="{{ base64_encode(base64_encode($val->id)) }}">
                                    {{ $val->category_name }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="form-group col-lg-3 col-md-6 col-sm-12">
                            <select class="custom-select-box select2 " name="subCatID" id="sub_category">
                                <option value="">@lang('language.HEADING_SELECT_SUB_CATEGORY')</option>
                                @foreach ($RecipeSubCategory as $val)
                                <option value="{{ base64_encode(base64_encode($val->id)) }}">
                                    {{ $val->category_name }}</option>
                                @endforeach
                            </select>
                        </div>

字符串
我已经尝试在选择前放置标签,状态显示:无,但仍然收到此字段错误
编辑:我检查过了,可能不是来自PHP的问题,可能是来自jquery-ui.js

_drawButton: function() {
        var that = this;

        // Associate existing label with the new button
        this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
        this._on( this.label, {
            click: function( event ) {
                this.button.focus();
                event.preventDefault();
            }
        });

        // Hide original select element
        this.element.hide();

        // Create button
        this.button = $( "<span>", {
            "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
            tabindex: this.options.disabled ? -1 : 0,
            id: this.ids.button,
            role: "combobox",
            "aria-expanded": "false",
            "aria-autocomplete": "list",
            "aria-owns": this.ids.menu,
            "aria-haspopup": "true"
        })
            .insertAfter( this.element );

        $( "<span>", {
            "class": "ui-icon " + this.options.icons.button
        })
            .prependTo( this.button );

        this.buttonText = $( "<span>", {
            "class": "ui-selectmenu-text"
        })
            .appendTo( this.button );

        this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
        this._resizeButton();

        this._on( this.button, this._buttonEvents );
        this.button.one( "focusin", function() {

            // Delay rendering the menu items until the button receives focus.
            // The menu may have already been rendered via a programmatic open.
            if ( !that.menuItems ) {
                that._refreshMenu();
            }
        });
        this._hoverable( this.button );
        this._focusable( this.button );
    },

zkure5ic

zkure5ic1#

当我做测试时,我发现问题来自js文件本身,通过添加“aria-lebel”:this.ids.menu,修复了错误问题

相关问题