A reactive, validated form built with WebSharper and WebSharper.Forms (reactive forms, see the WebSharper.Forms documentation): enter your details, add and reorder pets, and submit.
- Typed, composable forms with
Form.Returnand the applicative<*>operator. - Per-field validation that surfaces errors as you type
(
Validation.IsNotEmpty,submit.View.Through). - A dynamic collection of sub-forms with
Form.Many— add, move up/down and delete pets — plus a submit button that is only enabled when the form is valid.
src/Client.fsdefines thePerson/Petmodel and describes the form declaratively;Form.Renderturns it into the WebSharper.UI document that is rendered into the page.src/wwwroot/index.htmlholds the page header and the styles live insrc/wwwroot/css/index.css.
dotnet run --project src
Then open http://localhost:5294.
dotnet build src/Forms.fsproj -c Release
Every push to main builds in Release and publishes src/wwwroot to the
gh-pages branch via .github/workflows/deploy.yml.
