From a68b1b242a0e8e4c59daf3218e787b86fa1d497e Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:22:03 -0600 Subject: [PATCH] refactor: Rewrite Forms doc (#1218) --- content/en/guide/v10/forms.md | 411 ++++++++++++++---- .../controllers/repl/examples/style.css | 6 + 2 files changed, 331 insertions(+), 86 deletions(-) diff --git a/content/en/guide/v10/forms.md b/content/en/guide/v10/forms.md index bcb9b8012..6fdd02d6f 100755 --- a/content/en/guide/v10/forms.md +++ b/content/en/guide/v10/forms.md @@ -1,13 +1,11 @@ --- name: Forms -description: 'How to build awesome forms in Preact that work anywhere.' +description: 'Forms and form controls allow you to collect user input in your application and is a fundamental building block of most web applications.' --- # Forms -Forms in Preact work much the same as they do in HTML. You render a control, and attach an event listener to it. - -The main difference is that in most cases the `value` is not controlled by the DOM node, but by Preact. +Forms in Preact work in the same way as they do in HTML & JS: you render controls, attach event listeners, and submit information. --- @@ -15,100 +13,161 @@ The main difference is that in most cases the `value` is not controlled by the D --- -## Controlled & Uncontrolled Components +## Basic Form Controls + +Often you'll want to collect user input in your application, and this is where ``, `