Back to Browse

Django, HTMX and Alpine.js - Modals and Forms

16.7K views
Premiered Jun 3, 2022
23:07

โ–ถ Django & HTMX FULL COURSE: https://www.udemy.com/course/django-htmx-hypermedia-web-apps/?referralCode=8927C26ADA4349CD3928 โ–ถ HTMX & Django playlist: https://www.youtube.com/playlist?list=PL-2EBeDYMIbSP9TBPMsiMcRdLWeRzz1Gu โ˜• Buy a coffee: https://ko-fi.com/bugbytes In this video, we will see how to create a modal using TailwindCSS styles, and using Alpine JS to control the modal's visibility using different techniques. We'll see how to submit a form within the modal using HTMX, and how to display feedback on the page after submission. Modals are windows that appear on a UI and are designed to draw the user's attention to an important action. We'll show the basics of how to create a modal system with Alpine. In this video, we'll also show a couple of event modification techniques with Alpine, such as the "outside" modifier on a click event, and the "debounce" modifier. ๐Ÿ“Œ ๐—–๐—ต๐—ฎ๐—ฝ๐˜๐—ฒ๐—ฟ๐˜€: 00:00 Intro 02:00 Creating a Complaint Model 02:54 Creating a Complaint Form 04:05 Adding Form to View/Template 06:10 Creating an Alpine Component 07:50 Closing Modal with X Button 08:34 Closing Modal on Outside Click 09:57 Rendering Form Class Fields 12:47 Submitting Form with HTMX 16:23 Creating Success/Failure partials 18:28 Adding form validation method 20:44 Closing Modal after Submit (Alpine debounce modifier) ๐—ฆ๐—ผ๐—ฐ๐—ถ๐—ฎ๐—น ๐— ๐—ฒ๐—ฑ๐—ถ๐—ฎ: ๐Ÿ“– Blog: https://www.bugbytes.io/posts/ ๐Ÿ‘พ Github: https://github.com/bugbytes-io/ ๐Ÿ“š ๐—™๐˜‚๐—ฟ๐˜๐—ต๐—ฒ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—ฎ๐—ป๐—ฑ ๐—ถ๐—ป๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป: TailwindCSS modal: https://flowbite.com/docs/components/modal/ Alpine.js docs: https://alpinejs.dev/start-here Alpine modifiers: https://alpinejs.dev/directives/on#modifiers #django #alpinejs #python #tailwindcss

Download

0 formats

No download links available.

Django, HTMX and Alpine.js - Modals and Forms | NatokHD