Duplicates
Latest version
Current behavior 馃槸
When making a form post to a server function without explicit enctype it's first param is a URLSearchParams object.
Expected behavior 馃
The server function should retrieve a FormData object from a form post.
Steps to reproduce 馃暪
From the basic template, change the index route to the code below, start the server and click on the Hello button:
import { Title } from "@solidjs/meta";
import { action } from "@solidjs/router";
import Counter from "~/components/Counter";
const hello = action(async (data: FormData) => {
"use server"
console.log(data)
}, 'hello')
export default function Home() {
return (
<main>
<Title>Hello World</Title>
<h1>Hello world!</h1>
<Counter />
<form>
<input name="name" value="james" />
<button name="hello" value="world" formAction={hello} formMethod="post">Hello</button>
</form>
<p>
Visit{" "}
<a href="https://start.solidjs.com" target="_blank">
start.solidjs.com
</a>{" "}
to learn how to build SolidStart apps.
</p>
</main>
);
}
Context 馃敠
No response
Your environment 馃寧
OS: Linux
Browser: Zen (Firefox)
Node: v24.18.0
Duplicates
Latest version
Current behavior 馃槸
When making a form post to a server function without explicit
enctypeit's first param is aURLSearchParamsobject.Expected behavior 馃
The server function should retrieve a
FormDataobject from a form post.Steps to reproduce 馃暪
From the basic template, change the index route to the code below, start the server and click on the
Hellobutton:Context 馃敠
No response
Your environment 馃寧