This video shows how to use HTMX to show Django forms in modal dialog boxes.
The solution presented here requires very few JavaScript lines, renders form errors nicely, and refreshes the main page on success.
The following blog post contains a condensed version of this video:
The following GitHub repository contains a complete project demonstrating the technique:
Contact me on Codementor for live 1:1 mentoring:
@bblanchon
Table of Contents:
00:00 - Introduction
01:26 - Presentation of the original project
03:30 - Tour of the initial code
08:18 - import HTMX’s JavaScript
08:53 - Lazy load movie list
15:53 - Add a placeholder for the dialog
17:40 - Change form’s CSS
19:11 - Move the form
21:52 - Show the dialog
28:06 - FIx dialog’s Cancel button
29:24 - Perform POST request with HTMX
31:52 - Return an empty response on success
34:29 - Hide the dialog
42:01
7 views
10
5
3 months ago 01:51:39 17
Мододельская свечка №1 − Создание первого мода (Подкаст о мастерской Бесконечного лета)
3 months ago 00:00:00 1
ДЕВУШКА играет с подписчиками в кс 2. Общаюсь с чатом. #stream #КСГО #CSGO #cs2 #faceit #girl #кс2
3 months ago 00:03:54 1
How to do ACTIVE RECALL Effectively? (4 Techniques worked for me)
3 months ago 00:00:00 1
ДЕВУШКА играет с подписчиками в кс 2. Общаюсь с чатом. #stream #КСГО #CSGO #cs2 #faceit #girl rl
3 months ago 01:28:07 1
Issey Miyake – мода как искусство
3 months ago 00:56:44 1
Symphony No.2 “Saint Florian“ - Alfred Schnittke
3 months ago 00:28:57 1
Модальное окно (popup) практика HTML CSS JavaScript
3 months ago 00:00:00 1
ДЕВУШКА играет с подписчиками в кс 2. Общаюсь с чатом. #stream #КСГО #CSGO #cs2 #faceit #gerl
3 months ago 00:03:23 1
Sofia Reyes - 1, 2, 3 (feat. Jason Derulo & De La Ghetto) [Official Video]
4 months ago 00:00:00 1
ДЕВУШКА играет с подписчиками в кс 2. Общаюсь с чатом. #stream #КСГО #CSGO #cs2
4 months ago 00:00:00 1
Grand Theft Auto VС: Unsettling Night - Тревожная Ночь (Полный Обзор Мода)
4 months ago 00:43:43 17
GTA: Нижнеудинск by TRIXIE - Чисто Пацанские Разборки (Обзор Мода)
4 months ago 00:06:17 1
ЛИРА РАМОЗАНОВА коллекция “ЗАЦВЕЛА СИРЕНЬ НА КАВКАЗЕ“ на выставке-форм “Уникальная Россия“ 09 05 24г
4 months ago 00:00:00 1
ДЕВУШКА играет с подписчиками в кс 2. Общаюсь с чатом. +РОЗЫГРЫШ #stream #КСГО #CSGO #cs2
4 months ago 01:35:44 2
Как, зарабатывая миллионы, не потерять семью | Мода на разводы | Бизнес по-женски. Надежда Нестерова
5 months ago 00:05:13 1
Gerunds and Infinitives (Verbs): Fun & humorous ESL video to peak your students’ engagement!
5 months ago 00:05:21 10
How do you (not) write a fugue?
5 months ago 00:06:07 1
Урок 5. Модальные глаголы в итальянском языке. Итальянский язык за 7 уроков. Елена Шипилова.
5 months ago 00:03:06 1
Урок 5.1. Модальные глаголы sapere и conoscere (знать). Итальянская грамматика. Елена Шипилова.
5 months ago 00:17:14 1
Carl Vine - Piano Sonata No. 1
5 months ago 01:15:07 1
Orthodox Chants: Slavic Byzantine Liturgy of St. John Chrysostom | Christian Music with Lyrics
5 months ago 00:29:16 2
Эбигейл Соломон-Годо. Преследование и архивы в сегодняшний день
5 months ago 00:08:43 1
DIY Beautiful box idea | Cardboard idea | Paper craft