blob: 1261e4bfc39b07e9800d30432d14660cd657f732 (
plain)
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 React, { useState } from "react";
import "./Form.css";
const BillingForm = () => {
/*
const sampleData = [
{
"Model": "Kisan Chair",
"Description":"Very good chair",
"Price":"10000",
"Discount":"3%"
},
{
"Model": "Supreme Chair",
"Description":"Even better chair",
"Price":"2134983",
"Discount":"9%"
}
]
*/
const [itemValue, setItemValue] = useState("");
const [descValue, setDescValue] = useState("");
return (
<form onSubmit={
(event) => {
event.preventDefault();
console.log(itemValue, descValue);
}
}>
<label>
Item: <input type="text" value={itemValue} onChange={
(event) => {
setItemValue(event.target.value);
}
} />
</label>
<label>
Description: <input type="text" value={descValue} onChange={
(event) => {
setDescValue(event.target.value);
}
} />
</label>
<input type="submit" value="add" />
</form>
)
}
export default BillingForm;
|