-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignUp.jsx
More file actions
81 lines (79 loc) · 1.96 KB
/
SignUp.jsx
File metadata and controls
81 lines (79 loc) · 1.96 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React, { useState } from "react";
export default function SignUp() {
const [user, setUser] = useState({
name: "",
email: "",
password: "",
});
const handleSubmit = (e) => {
e.preventDefault();
console.log(user);
};
const changeVal = (e) => {
setUser({ ...user, [e.target.id]: e.target.value });
};
return (
<>
<form
onSubmit={(e) => {
handleSubmit(e);
}}
>
<div className="mb-3">
<label for="name" className="form-label">
UserName
</label>
<input
onChange={(e) => {
changeVal(e);
}}
value={user.name}
type="text"
className="form-control"
id="name"
aria-describedby="emailHelp"
/>
</div>
<div className="mb-3">
<label for="email" className="form-label">
Email address
</label>
<input
onChange={(e) => {
changeVal(e);
}}
value={user.email}
type="email"
className="form-control"
id="email"
aria-describedby="emailHelp"
/>
</div>
<div className="mb-3">
<label for="password" className="form-label">
Password
</label>
<input
value={user.password}
onChange={(e) => {
changeVal(e);
}}
type="password"
className="form-control"
id="password"
/>
</div>
<div className="mb-3 form-check">
<input
type="checkbox"
className="form-check-input"
id="exampleCheck1"
/>
</div>
<button type="submit" className="btn btn-primary">
Submit
</button>
</form>
</>
);
}