In this video, we look at how to dynamically create forms using Django and HTMX, and look at how to dynamically submit these forms - both individually, and as a group.
We'll see some cool tricks here, such as:
- Using the hx-on attribute to perform actions after submission
- Using the "from" trigger modifier to trigger submission of all forms via a single button click
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
[ Ссылка ]
▶️ Full Playlist:
[ Ссылка ]
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:43 Defining model and ModelForm
02:53 Adding Form to View and Template
07:21 Adding forms dynamically with HTMX
12:04 Submitting forms individually with HTMX
13:55 Adding contact list to template
17:36 Removing form after submission with hx-on attribute
19:13 Submitting multiple forms at once with HTMX
22:02 Adding Cancel button to clear forms
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: [ Ссылка ]
👾 Github: [ Ссылка ]
🐦 Twitter: [ Ссылка ]
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
django-htmx-todo-list (Jack Linke): [ Ссылка ]
hx-swap: [ Ссылка ]
hx-on: [ Ссылка ]
django-htmx CSRF tip: [ Ссылка ]
#django #python #htmx
Ещё видео!