Hyperscript and HTMX - Form Examples with Django

  Рет қаралды 8,078

BugBytes

BugBytes

Күн бұрын

In this video, we'll look at some form-related examples that use Hyperscript and HTMX.
Notably, we'll see how to:
1. Submit a form with HTMX
2. Disable submit button using hyperscript while the HTMX request is in-flight
3. Clear the text from the input field after submission, using hyperscript
4. Use the Fetch API with hyperscript and process JSON data
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugb...
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: www.bugbytes.i...
👾 Github: github.com/bug...
🐦 Twitter: / bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Hyperscript: hyperscript.org/
Hyperscript docs: hyperscript.or...
HTMX Events: htmx.org/events/
Hyperscript Fetch command: hyperscript.or...
#django #htmx #hyperscript #python

Пікірлер: 30
@banka990
@banka990 7 ай бұрын
I spent a whole day trying to figure out how to conditionally change the hx-target and hx-swap based on whether the form was valid or invalid, and here comes the savior. Just amazing content! ❤
@bugbytes3923
@bugbytes3923 7 ай бұрын
Thanks a lot man! Glad to have helped!
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 2 жыл бұрын
You make us so happy with your videos the same way the Santa Claus makes children happy with gifts. Thank you for all. GOD bless you mate !
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you so much mate, I appreciate the support!
@johnsonberko1409
@johnsonberko1409 2 жыл бұрын
I love your videos. I want more videos on htmx and hyperscript. You are awesome.
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks a lot, appreciated!
@tobidegnon4409
@tobidegnon4409 2 жыл бұрын
Great video, I'm really loving these htmx tutorials
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks Tobi!
@reuna4c3
@reuna4c3 2 жыл бұрын
Cool video. Fast pace, but really educative. htmx and hyperscript together helps forgeting JS :)
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Indeed! Thanks very much!
@FirdausAziz
@FirdausAziz 2 жыл бұрын
HTMX + HyperScript + Django = Happiness
@Mooooooooooooooooot
@Mooooooooooooooooot 2 жыл бұрын
Fantastic video. Thank you!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you very much!
@jonathacarneiro
@jonathacarneiro 2 жыл бұрын
excellent video, congratulations!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks very much, glad you liked this!
@ernestoperezamigo4866
@ernestoperezamigo4866 2 жыл бұрын
Great video !!! I have been following your channel for a few months and every video you make is super interesting and very useful for the community. Congratulations!!!! Question, based on your experience, which approach would you most like to use if you had to start a medium-sized project: 1- Django + Django-Unicorn, 2- Django + HTML + AlpineJS, 3- Django + HTMLX + Hyperscript, 4- Another approach, which one? Big hug
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you Ernesto! I appreciate the support :) For a medium size project, I'd go with Django, HTMX and Hyperscript these days. There's a lot of flexibility with what you can do with these tools. But they are all solid choices, and I'll be creating many more videos on different choices for different applications and use-cases.
@sessionone1
@sessionone1 Жыл бұрын
Your videos are great! You explain everything very well :) A question, if you don't mind.. How would you reset a select to the after submit? You explain how to clear an input field, but if I have select next to input, how would I go back to the initial value? Thank you :)
@onnot701
@onnot701 2 жыл бұрын
superb explenation
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks very much!
@gerhardspitzlsperger1567
@gerhardspitzlsperger1567 2 жыл бұрын
Great content
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks!
@franciscodelafruitas9424
@franciscodelafruitas9424 2 жыл бұрын
This was pure goodness! Could this be used for an ecommerce app, for example user has added more items than are available in stock, perhaps add it in with django-unicorn, or would it be too hacky?
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thanks a lot! You could certainly use these tools to look up stock numbers on the backend, and conditionally display forms and messages! I think it'd be an interesting project to do a full ecommerce example with these tools, and I'm considering building a complete course in this.
@realdanielpeach
@realdanielpeach Жыл бұрын
I love the abilities that htmx, alpine, hyperscript give us, but I can't help but think "yay spaghetti code is back!" while watching these disparate parts be pulled and stuck wherever is convenient.
@BathingAfrican
@BathingAfrican 2 жыл бұрын
are all these django tuts possible in fastapi? django looks too beefy and bloated for me
@bugbytes3923
@bugbytes3923 2 жыл бұрын
With modifications, yes. For example, you won't have the Form class abstraction in FastAPI. If you configure FastAPI to work with HTML templates (as opposed to just returning JSON) then it can all work seamlessly.
@rmireckiyt
@rmireckiyt 2 жыл бұрын
What font & vscode theme are you using ? Thanks for the videos!
@universaltoons
@universaltoons Жыл бұрын
Dark+ (the default one, not Dark Modern) with Consolas I think
@ateftech8969
@ateftech8969 6 ай бұрын
please code source
Hyperscript and HTMX - Creating an Interactive Book Form
27:14
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
The Truth About HTMX
12:27
Theo - t3․gg
Рет қаралды 173 М.
Creator of HTMX Talks HTMX
1:02:41
ThePrimeTime
Рет қаралды 186 М.
Building Real-time Apps with Go | Azim Pulat
54:58
Azim Pulat
Рет қаралды 66 М.
3 years of htmx + Django!
59:22
hypermedia-tv
Рет қаралды 1,7 М.
I tried HyperScript by HTMX...It's a MIRACLE
9:37
DevTalk with FK
Рет қаралды 3,1 М.
HTMX and the View Transitions API
20:21
BugBytes
Рет қаралды 15 М.
Building with Django + HTMX
3:24:19
Dennis Ivy
Рет қаралды 3,6 М.
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН