Back to all speakers
HM

Hanne Moa

Biography will be published soon.

Django forms in the age of HTMx: the single field form

Talk
There are many ways to do "interesting" things with forms... With HTMx it is possible to treat any HTML tag as a form, without using form tags. It becomes easy to alter just one field of a form: click on the field to swap out the presentation with a suitable input field, then submit that single field on pressing Enter. What is not necessarily so easy is adapting the use of Django's forms so that they are used both for validation and rendering of that single field, and smuggling in the necessary context a form widget needs if one skips the <form>-tag and uses widget templates to render the inputs. Incidentally it does become easy to have plugin-able forms... This talk will briefly look at previous "interesting" (ab)uses of Django forms, followed by demonstrating some hands-on techniques and patterns for working with single fields, using a special made demonstration site and a production service that was converted in 2024-2025 from a SPA using REACT to an MPA using HTMx: Argus. Django: https://docs.djangoproject.com/ HTMx: https://htmx.org Live Argus demo: https://argus-demo.uninett.no/ Argus code: https://github.com/Uninett/Argus