how to make MDBSelectInput a required field

Topic: how to make MDBSelectInput a required field

Paul TP asked 3 years ago

I am trying to make MDBSelectInput a required field but I am not winning. Below is an example: eturn ( {option.text} ); }); return ( {options} {this.props.label} );

Jakub Chmura staff premium answered 3 years ago

Hi @Paul TP

You probably had a problem with paste example code.

I understand that you want to make MDBSelect as a required field, so then you need just add required props to MDBSelect instead of MDBSelectInput. If you do this everything should work fine.

If there is anything else I could do for you do not hesitate to ask me. I'll be happy to help you.

Best regards,


Paul TP commented 3 years ago

hi @Jakub Chmura I have tried that but did not get any luck.

                        // required={this.props.required}
                            readOnly: false,
                            onChange: this.props.handleChange

Jakub Chmura staff premium commented 3 years ago

Please look to this page. On the top of this page click API and there you can see how to use props on MDBSelect.

I see that you use required on MDBSelectInput but it's not possible to use these props on this component because it doesn't have that props. You can only use selected props on MDBSelectInput.

In the MDBSelect component try to use just required props. not required={true}.

Best regards,


Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.6.1
  • Device: Laptop
  • Browser: chrome
  • OS: Linux Fedora
  • Provided sample code: No
  • Provided link: No