Mandatory dropdown

Is it possible to set a dropdown as mandatory?

Hello @pedromsouza,

Can you define required? Technically, you could abort the callback if it is empty.

I tried setting “clearable = False”, but it didn’t work. How could I abort the callback?

Something like this:

if value is None or value == '':
    return no_update

Or with your return, you could output to a modal that tells the user they need to fill in that field.

You could also make it so there is a submit button that isnt enabled until all the proper fields are filled in.

2 Likes