Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
45
rated 0 times [  52] [ 7]  / answers: 1 / hits: 30467  / 7 Years ago, mon, october 16, 2017, 12:00:00

I was just going through the React-bootstrap form what is the use of controlId is it similar to name we use in legacy form?



<form>
<FormGroup
controlId=formBasicText ---------------------->> what is the use?
validationState={this.getValidationState()}
>
<ControlLabel>Working example with validation</ControlLabel>
<FormControl
type=text
value={this.state.value}
placeholder=Enter text
onChange={this.handleChange}
/>
<FormControl.Feedback />
<HelpBlock>Validation is based on string length.</HelpBlock>
</FormGroup>
</form>

More From » reactjs

 Answers
109

You can find it here in the v3 docs:



Sets id on <FormControl> and htmlFor on <FormGroup.Label>.



Basically it's the input's id and the label's for attribute.


enter


[#56212] Friday, October 13, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hakeemabramh

Total Points: 234
Total Questions: 109
Total Answers: 109

Location: Romania
Member since Mon, Jun 6, 2022
2 Years ago
;