Reputation: 389
I'm trying to create a feedback form using react redux form and I'm kind of struggling with the checkbox implementation
Here is what my web page is rendering:
Here is the code snippet I'm using:
import { Breadcrumb, BreadcrumbItem, Button, Label, Row, Col } from 'reactstrap';
import { Control, LocalForm, Errors } from 'react-redux-form';
<Row className="form-group">
<Col md={{size:3, offset:3}}>
<Control.checkbox model=".agree" id="agree" name="agree"
className="form-control"
/>
<Label htmlFor="agree">May we contact you?</Label>
</Col>
<Col md={6}>
<Control.select model=".type" id="type" name="type"
className="form-control">
<option value="1">Tel.</option>
<option value="2">Email</option>
</Control.select>
</Col>
</Row>
Why is my checkbox too big and my label not aligned with the checkbox?
Upvotes: 1
Views: 134
Reputation: 227
Try this:
<Row className="form-group">
<Col md={{size: 3, offset: 3}}>
<div className="form-check">
<Label check>
<Control.checkbox
className="form-check-input"
model=".agree"
name="agree"
id="agree"
/>May We Contact You?
</Label>
</div>
</Col>
<Col md={6}>
<Control.select
className="form-control"
model=".type"
name="type"
id="type"
>
<option value="1">Tel.</option>
<option value="2">Email</option>
</Control.select>
</Col>
</Row>
Upvotes: 1
Reputation: 398
try it:
<Row className="form-group">
<Col md={6}>
<Label htmlFor="agree">
<Control.checkbox model=".agree" id="agree" name="agree"
className="form-control" />{' '}
May we contact you?</Label>
</Col>
<Col md={6}>
<Control.select model=".type" id="type" name="type"
className="form-control">
<option value="1">Tel.</option>
<option value="2">Email</option>
</Control.select>
</Col>
</Row>
Upvotes: 0