summaryrefslogtreecommitdiff
path: root/src/pages/logintest/ServerForm.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/logintest/ServerForm.tsx')
-rw-r--r--src/pages/logintest/ServerForm.tsx67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/pages/logintest/ServerForm.tsx b/src/pages/logintest/ServerForm.tsx
deleted file mode 100644
index 8e629b8..0000000
--- a/src/pages/logintest/ServerForm.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-async function submitUserProfile(formData: FormData) {
- "use server";
- const name = formData.get("name");
- const age = formData.get("age");
- const favoriteColor = formData.get("favoriteColor");
- const hobby = formData.get("hobby");
- const isSubscribed = formData.get("newsletter") === "on";
-
- console.log({
- name,
- age,
- favoriteColor,
- hobby,
- isSubscribed,
- });
-}
-
-export const ServerForm = () => {
- return (
- <form action={submitUserProfile} className="space-y-4">
- <div style={{ display: "flex", gap: 4, marginBottom: 4 }}>
- <label htmlFor="name">Full Name</label>
- <input type="text" name="name" id="name" required />
- </div>
-
- <div style={{ display: "flex", gap: 4, marginBottom: 4 }}>
- <label htmlFor="age">Age</label>
- <input type="number" name="age" id="age" min="13" max="120" />
- </div>
-
- <div style={{ display: "flex", gap: 4, marginBottom: 4 }}>
- <label htmlFor="favoriteColor">Favorite Color</label>
- <select name="favoriteColor" id="favoriteColor">
- <option value="red">Red</option>
- <option value="blue">Blue</option>
- <option value="green">Green</option>
- <option value="purple">Purple</option>
- <option value="yellow">Yellow</option>
- </select>
- </div>
-
- <div style={{ display: "flex", gap: 4, marginBottom: 4 }}>
- <label htmlFor="hobby">Favorite Hobby</label>
- <input
- type="text"
- name="hobby"
- id="hobby"
- placeholder="e.g. Reading, Gaming, Cooking"
- />
- </div>
-
- <div style={{ display: "flex", gap: 4, marginBottom: 4 }}>
- <label>
- <input type="checkbox" name="newsletter" />
- Subscribe to newsletter
- </label>
- </div>
-
- <button
- type="submit"
- className="hover:bg-slate-50 w-fit rounded-lg bg-white p-2"
- >
- Save Profile
- </button>
- </form>
- );
-};