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
12
5
2 months ago 00:16:33 1
🎃 Phrasal Verbs for Halloween! 🎃
2 months ago 00:33:27 1
GTA 3: Infected Liberty - Непроглядная Мгла (Обзор Мода)
3 months ago 00:06:51 23
Brown Leather High Cut Bodysuit, Shiny Brown Vinyl Leggings and Heeled Sandals
3 months ago 00:18:15 1
Common Mistakes, Collocations with Get, Conversation Practice - Sound Like a Native Speaker!
3 months ago 00:56:42 1
The Power of Methylene Blue | Dr. Steve Warren & Dan Schmidt | THE DR. JOY. KONG PODCAST
3 months ago 00:05:46 1
Filament Profile Page: Work Experiences List with Modal
3 months ago 00:18:24 1
Master 9 Types of English Questions | Grammar Lesson
3 months ago 00:09:47 32
FS 22 - Обзор мода “КамАЗ-5490/65206 Нео“
3 months ago 00:05:24 1
Had better in English grammar – Giving advice – English Grammar lesson
3 months ago 00:13:33 1
«Мода как праздник: лоскутная живопись Татьяны Смирновой».
4 months ago 00:08:05 1
МОД НА ПЕЧИ И СОЗДАНИЕ В МАЙНКРАФТ ► 100 дней 100 модов. Обзор мода Molten Metal, Burning Furnace#30
4 months ago 00:28:26 2
40 Rules For Would (Advanced English Grammar)
4 months ago 00:00:00 1
ДЕВУШКА СТРИМИТ CS 2. КОГДА Я УЖЕ АПНУСЬ?? ОБЩАЮСЬ С ЧАТОМ. stream #CSGO #cs2 #faceit #girl #кс2
4 months ago 00:14:29 1
“I USED TO”, “I GOT USED TO”, “I’M USED TO”: What’s the difference?!
4 months ago 01:28:07 2
Issey Miyake – мода как искусство
4 months ago 01:05:42 1
Rainy Jazz - Music for Relax, Sleep / Jazz History
4 months ago 00:16:34 1
5 ways to use ’SHOULD’ in English
4 months ago 00:15:18 1
Learn English Grammar: DIRECT & INDIRECT SPEECH (REPORTED SPEECH)
4 months ago 00:00:00 1
ДЕВУШКА СТРИМИТ CS 2. ВОЗРАЩЕНИЕ В КС, ВСЁ ПО НОВОЙ. stream #CSGO #cs2 #faceit #girl #кс2
4 months ago 00:06:12 1
Mystic Music for meditation - Azerbaijanian mugam on ud
5 months ago 00:07:15 1
English Grammar: Modal Verbs of Certainty – MIGHT, MAY, MUST, CAN
5 months ago 00:13:08 1
BT - Five Hundred and Eighty Two
5 months ago 00:00:59 1
Как СУМКА за 500 рублей СОРВАЛА многомиллионный КОНТРАКТ! Когда мода решает | Александр Соро
5 months ago 00:07:48 1
Zero Conditional - Conditional Sentences: Creative & engaging animated ESL video for teachers to use