Remove blank option from required Dropdown reference selector

1
Hello, I haven't found the way to remove the blank option that appears in the dropdown boxes of a reference selector:   I have set up the combo box as "Required", and if I select the blank option, a message appears:   Is there a way to make this blank option disappear?
asked
3 answers
17

You can go the CSS route. Create a new CSS class (in this case dropdown-no-empty), then define it to hide the first option tag under select tags under objects with the new class.

Note: This is in SCSS.

.dropdown-no-empty {
    select>option:first-child {
        display: none;
    }
}

Assign the class to your reference selector.

answered
1

You could use the format JS widget to remove it.

Refer to the dropdown selector and remove the empty value.

 

answered
0

See this idea for some code you can use in an HTMLSnippet widget:

https://forum.mendix.com/link/ideas/26

answered