I think I’ve tried everything I can think of and read about the Forms I can not get my code to submit to Netlify forms. The info I fill out in my form shows in the logs. On my form page after filling out the 3 input ares and SUBMIT I get “Message submitted successfully!”
site = chyouz.com
import { Link, MetaFunction, useActionData, Form } from “@remix-run/react”;
import { useOptionalUser } from “~/utils”;
import { json } from ‘@remix-run/node’;
export const meta: MetaFunction = () => {
return [
{ title: “chYOUz Home Page - Personalized Songs for Your Slideshows” },
{ name: “description”, content: “Personalized songs created by chYOUz for custom slideshows and special occasions.” }
];
};
// The action function is not necessary for Netlify forms since Netlify handles the form submission
export const action = async ({ request }) => {
let formData = await request.formData();
let name = formData.get(“name”);
let email = formData.get(“email”);
let message = formData.get(“comments”);
// Handle form data (e.g., send email, save to database, etc.)
// For now, let’s just log it to the console
console.log({ name, email, message });
return json({ success: true });
};
export default function Index() {
const user = useOptionalUser();
const actionData = useActionData();
return (
chYOUz
Personalized songs for your moments and memories.
{/* You still need to add the hidden input with the form name to your JSX form */}
Don’t fill this out if you’re human:
Name
Message?
Submit message
{actionData?.success && (
Message submitted successfully!
)}
{user ? (
View Notes for {user.email}
) : (
Order
ABOUT
EXAMPLES
PRICING
Contact
)}
);
}
