Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.12k stars 4.94k forks source link

Form.Dropdown - Error message should display and field should turn red if left blank #6917

Open lucyc426 opened 4 years ago

lucyc426 commented 4 years ago

Expected Result

I currently have 3 Form.Dropdown fields which are required fields. If the user presses "next" without making a selection in those 3 fields, I would like the dropdowns to turn red and display one error message as to what they need to do to correct the issue.

Actual Result

I am not sure how to do the form validation, so right now the boxes are permanently red and the error message is always there.

The dropdown field:

<Form.Dropdown defaultValue={this.state.initial} inline //control={Dropdown} label='Home' selection className="dropdown2" name='home' value={home} error required />

Next button: ` <Button color = "green" type="submit" className="nextbuttonuser" onClick={this.handleClick} onSubmit={this.handle}

                        > Next   <i class="right arrow icon"></i></Button>`