-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form4.js
56 lines (47 loc) · 1.51 KB
/
Form4.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { useState } from 'react';
import Button from 'react-bootstrap/Button';
import Col from 'react-bootstrap/Col';
import Form from 'react-bootstrap/Form';
import InputGroup from 'react-bootstrap/InputGroup';
import Row from 'react-bootstrap/Row';
function FormExample() {
const [validated, setValidated] = useState(false);
const handleSubmit = (event) => {
const form = event.currentTarget;
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
setValidated(true);
};
return (
<Form noValidate validated={validated} onSubmit={handleSubmit}>
<Row className="mb-3">
<Form.Group as={Col} md="4" controlId="validationCustom01">
<Form.Label></Form.Label>
<Form.Control
required
type="text"
placeholder="Search Manufacturer"
defaultValue=""
/>
<Form.Control.Feedback></Form.Control.Feedback>
</Form.Group>
</Row>
<Row className="mb-3">
<Form.Group as={Col} md="4" controlId="validationCustom01">
<Form.Label></Form.Label>
<Form.Control
required
type="text"
placeholder="Item Number"
defaultValue=""
/>
<Form.Control.Feedback>Looks good!</Form.Control.Feedback>
</Form.Group>
</Row>
<Button type="submit">Submit</Button>
</Form>
);
}
export default FormExample;