Language dropdown with default value?

0
we have a language selector and are using the dropdown widget. 1. there is a default language selected (because the user can read the page in that language) 2. in the widget there is also an emptyvalue of the enum that should be hidden. is there a way to solve these issues?  
asked
4 answers
2

Copied your answer for you Jason:

answered
3
.custom_languagedropdownclass{
  .form-control option:first-child{
    display: none;
  }
}

answered
1

Hello Jason,

Assuming this is a user language selector relating to the system module, probably the safest way to default the language would be to apply the default language on user creation, and to always validate your object commits to have a language selected. 

As for the empty issue, I've never been able to get rid of the empty option in the default widget. Have you tried different widgets? 

Perhaps something like the DropdownSelector might cut it or if you want your dropdowns to use the default widget consistently through your app a radiobutton selector might do it (If I remember correctly empty is not an option on this).

Hope this helps

answered
0

Don't know if i understand your question correct but i don't think it's possible to hide the empty value of an enumeration. You could do something with a on change mf when this is selected and restore the previous value, but thats not pretty.

answered