F03

Error

Forms and bindings

F03 — A validate block no control can satisfy

The rules of a validate block are shown on the control bound to the state, and a form is valid when they pass. On a state no control binds, or a derived value, they can never pass, and the submit stays disabled.

What the compiler said

error[F03]: `validate email` guards a state no control binds, so its rules can never be met --> src/App.wf:3:5 | 3 | validate email { required email } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: Bind it to the control the reader fills in: `Input(bind: email, …)` = docs: https://webfluent.monzeromer.dev/errors/F03

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state email = "" validate email { required email } Heading("Join").h1 Form { Button("Join", type: .submit) } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state email = "" validate email { required email } Heading("Join").h1 Form { Input(bind: email, label: "Email").email Button("Join", type: .submit) } }

Bind the state to the control the reader fills in: Input(bind: email, label: "Email").email.

Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).

lints cannot lower it: it would ship a broken page.