Skip to content

Commit 6f64290

Browse files
committed
Use form in user submission in frontend
1 parent f36a9f3 commit 6f64290

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/frontend/my-app/src/Components/CreateUserComponent.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,25 @@ export default function CreateUserComponent (){
2828

2929
return(
3030
<div className="create-user-box">
31-
<input
31+
<form onSubmit={sendUser}>
32+
<input
3233
onChange={(e) => setUsername(e.target.value)}
3334
placeholder="Set username"
3435
required
35-
36-
></input>
37-
<input
36+
/>
37+
<input
3838
onChange={(e) => setEmail(e.target.value)}
3939
placeholder="Set email"
4040
required
41-
42-
></input>
43-
<input
41+
/>
42+
<input
43+
type="password"
4444
onChange={(e) => setPassword(e.target.value)}
4545
placeholder="Set password"
4646
required
47-
48-
></input>
49-
<button
50-
onClick={sendUser}
51-
>Send User</button>
47+
/>
48+
<button type="submit">Send User</button>
49+
</form>
5250
<h3>{message}</h3>
5351
</div>
5452

0 commit comments

Comments
 (0)