Skip to content
ZOLO / TE777 Type · error

typed progressive form has an unsupported contract

A function-valued form action must reference an @action with explicit str, int, float or bool parameters, use URL-encoded POST, and return to a local absolute path. Use a URL action or another endpoint for other transports.

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.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br