Topic: Retrieve Value from React MultiSelect form

bubbakush4 free asked 4 years ago


Expected behavior Trying to get the value of a multi-select option inside of one of my forms. Actual behavior Its not registering. Form is inside a class component. Resources (screenshots, code snippets etc.)

<MDBSelect label='I Want to Volunteer For:'
                                        // options={this.state.volunteer}
                                        getValue={(e) => this.setState({ value: e[0] })}
                                        value={this.state.value}>
                                        <MDBSelectInput name='Volunteering For:' selected={this.state.value} required />
                                        <MDBSelectOptions>
                                            <MDBSelectOption value="Meal Delivery" name="Meal Delivery">Meal Delivery (Tuesday - Saturday AM)</MDBSelectOption>
                                            <MDBSelectOption value="Meal Prep" name="Meal Prep">Meal Preparation (Mon-Fri, 9am-6pm)</MDBSelectOption>
                                            <MDBSelectOption value="Home Repair" name="Home Repair">Home Repair (Saturday Mornings)</MDBSelectOption>
                                            <MDBSelectOption value="Admin" name="Admin">Administrative</MDBSelectOption>
                                            <MDBSelectOption value="Purposeful" name="Purposeful">Purposeful Products</MDBSelectOption>
                                            <MDBSelectOption value="Other" name="Other">Other</MDBSelectOption>
                                        </MDBSelectOptions>
                                    </MDBSelect>

Piotr Glejzer staff commented 4 years ago

Can you show me all your code about that with all methods etc?



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: no
  • Browser: Chrome
  • OS: Mac
  • Provided sample code: No
  • Provided link: No