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>
You can find it here in the v3 docs:
Sets id on
<FormControl>
andhtmlFor
on<FormGroup.Label>
.
Basically it's the input's id
and the label's for
attribute.