Topic: Any way to get the value of MDBSelect from the onChange event?

gauravjain-blueport free asked 3 years ago


Is there any way to get the selected value from an MDBSelect dropdown from the onChange event? I'm thinking something like this should work but the onChange does not trigger...

<MDBSelect label="Example label" onChange={(event) => console.log(event.target.value)}>
         <MDBSelectInput selected="Choose your option" />
                     <MDBSelectOptions search>
                             <MDBSelectOption value="" disabled selected>Choose your country</MDBSelectOption>
                             <MDBSelectOption value="1">USA</MDBSelectOption>
                             <MDBSelectOption value="2">Germany</MDBSelectOption>
                             <MDBSelectOption value="3">France</MDBSelectOption>
                             <MDBSelectOption value="3">Poland</MDBSelectOption>
                             <MDBSelectOption value="3">Japan</MDBSelectOption>
                     </MDBSelectOptions>
</MDBSelect>

Piotr Glejzer staff commented 3 years ago

did you see API section? https://mdbootstrap.com/docs/react/forms/select/#docsTabsAPI



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.27.0
  • Device: Macbook
  • Browser: Chrome
  • OS: iOS
  • Provided sample code: No
  • Provided link: No