A function-valued form action uses application/x-www-form-urlencoded POST.
The referenced function must declare @action, which publishes its endpoint.
Each action parameter must explicitly declare str, int, float, or bool.
Optional, variadic, destructured, collection, and record parameters require a
different transport in this first version. Actions used through JSON retain
their existing Wire contracts.
@action
fn salvar(idade: int, novidades: bool) -> str { return "ok" }
<form action={salvar} return_to="/sucesso">
<input name="idade" type="number" />
<input name="novidades" type="checkbox" />
</form>Omit method and enctype to use the generated defaults. Explicit method="get",
multipart encoding, or dynamic transport settings conflict with this contract.
Use an ordinary URL action for other HTML form transports.
return_to must be a local absolute path beginning with /, without a leading
// or backslashes. The server checks the submitted destination as well.
Missing numeric fields remain errors even when the action declares a default;
defaults do not replace invalid or missing submitted input. An unchecked bool
checkbox is false.