Django & HTMX - Dynamic Form Creation and Submission

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 109

  • @AmoahDevLabs
    @AmoahDevLabs Рік тому +5

    I can't believe you're still doing these tutorials. Your work is beyound expectations. To be frank with you, "You're very much sefless". You always enlighten people. This is what I call the TRUE GOSPEL. I really appreciate all your works.

  • @立法院很忙
    @立法院很忙 Рік тому +8

    Whenever I see new BugBytes videos, I click "like" first, before grabbing a drink to go along with watching the video. 😁

  • @aleksmith2808
    @aleksmith2808 Рік тому +6

    Came from another one of your videos, you can't imagine my relief when I saw you also do htmx tutorials. Keep up the great work, love the Django and HTMX content

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thanks a lot Alek! Glad you're liking the content - will keep going 💪

  • @lucidcatnap
    @lucidcatnap Рік тому +3

    Subscribed for the amazing combination of relevant web development content and a Scottish accent

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thank you, and greetings from Glasgow! 😄

  • @trosgate
    @trosgate Рік тому +3

    I have no doubt that this teacher will reach 10,000 users in no time. Simple reason is that he knows how to implement and utilize the capabilities of external packages

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thanks a lot for the nice comment, really appreciate it!

  • @ABMA79
    @ABMA79 Місяць тому

    One of the best tutorials I have seen so far for you....
    Thanks a lot.

    • @bugbytes3923
      @bugbytes3923  Місяць тому

      Thanks a lot, glad you liked it!

    • @ABMA79
      @ABMA79 Місяць тому

      @@bugbytes3923 I hope you can design an e-commerce website and make it as a series of tutorials. You are among the best in terms of explaining the steps.

  • @graczew
    @graczew Рік тому +4

    Your content is a pure gold mate. Thanx for your time and effort to make this.

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thanks a lot mate. Glad it's being well received!

    • @graczew
      @graczew Рік тому

      @@bugbytes3923 I'm follow your channel for longer time and content is really useful. I just hope you will not stop make django content.

    • @bugbytes3923
      @bugbytes3923  Рік тому

      @@graczew Thanks a lot for the support over the time, Krzysztof. Django will always be a core part of the content, even with some other stuff mixed in.

  • @bitpilot79
    @bitpilot79 11 місяців тому +2

    You have the best videos on HTMX. Thanks for sharing.

    • @bugbytes3923
      @bugbytes3923  11 місяців тому

      Thanks a lot, appreciate it!

  • @s.victor7740
    @s.victor7740 4 місяці тому +1

    This is awesome; keep on the good work. The video explains what I need to complete my project.

    • @bugbytes3923
      @bugbytes3923  4 місяці тому

      Glad to hear the video has helped! Thank you for the support!

  • @seydinaoumarsamabaly1806
    @seydinaoumarsamabaly1806 Рік тому +2

    Master🙌🏾 , just a delight your tutorials from the day one till today. Thank for everything you're doing for others.

  • @fernandtape9363
    @fernandtape9363 Рік тому +6

    Welcome back HTMX. Great as always. Can't wait for the coming full project.

  • @dovh49
    @dovh49 Рік тому

    When working with vanilla forms like this `hx-boost=true` is a great attribute. As for having the button outside of the form you could simply use the `form` attribute, like this `Submit`.

  • @craigphollingsworth1460
    @craigphollingsworth1460 Рік тому

    Great video again! Really, really helpful. Would love to see a follow up on how you would handle validation on the multiple submit.
    cheers

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thanks a lot Craig!
      Will look into an extension of the video 👍

  • @ermalgashimramori
    @ermalgashimramori Рік тому +1

    As always great great content.

  • @Peterstavrou
    @Peterstavrou Рік тому +1

    Another excellent video!

  • @bal_mahmuda
    @bal_mahmuda Рік тому

    mantap, makasih bug bytes. bagus banget nama channel nya.

  • @MalfuncEddie
    @MalfuncEddie Рік тому +2

    Maybe an idea for the next video (django,htmx):
    How do you create a "wizard" where the questions influence each other.
    like
    formA yes/no question (Would you like to know more)
    if yes ->
    ask for mail(q1a)
    ask for name (q1b)
    --> go to formB
    if no ->
    go to form C
    formB yes/no question (Would you like to know our promo's)
    if yes: Ask more questions
    if no: go to end
    ....
    at the end I it should return a dict with
    { q1: true,
    q1a: "answer",
    q1b: "answer",
    q2: false,
    q2a: "",
    q2b: "",
    q3: ...
    }
    I know there are "questionaire" django projects but for some reason I can't get my head around them.

  • @JayJay-th3hd
    @JayJay-th3hd Рік тому

    Nice work! Every video is very helpful to understand django and htmx!
    In this example it's possible to limit the number of forms where the user can create?
    hx-get="{% url 'create-contact' %}"
    hx-target="#contact-forms"

  • @SkeechFab
    @SkeechFab Рік тому +1

    Spectacular mate thx! How would you dynamically add more fields/rows to one form? For example, you want to add and number for some, but then want to add additional information, rows, for other contacts and the additional info isn't necessarily 'name' and 'number'.

  • @95myou
    @95myou Рік тому

    it would be really cool if you can add an auto-complete to form line :D BTW really cool content

  • @o3cloudng357
    @o3cloudng357 6 місяців тому

    Hello BugBytes, You have been amazing since I found your channel. Can you make a video on how to use htmx to update dynamic forms /formset like this one

  • @kellyqiu7784
    @kellyqiu7784 Рік тому +1

    Thank you! could you please also upload the starter code for this?

  • @ayubkara1092
    @ayubkara1092 Рік тому +1

    thank you as always for the great content , can't help but ask will you ever consider doing something about Django Channels maybe in the future ?

    • @bugbytes3923
      @bugbytes3923  Рік тому +1

      Thanks a lot! I did this video on Websockets + HTMX that uses Django-Channels.
      ua-cam.com/video/FcVwDEcu6K0/v-deo.html
      There will be a full course on Channels this year at some point. I'll start planning this when I get some time in a few months.

  • @UmutAlverGuclu-xg8ex
    @UmutAlverGuclu-xg8ex Рік тому

    Thank you! How would you add inline editing - htmx?

  • @UsGreg
    @UsGreg Рік тому +4

    Please, make hx-boost tutorial :)

  • @hakanbilgin6875
    @hakanbilgin6875 5 місяців тому

    thank you good informations.

  • @zawanns
    @zawanns Рік тому

    Thank you so much for your content, always helpful. I’ve just used this method and it works perfectly. And i’d like to know what if in the partial form we want to use django-select2 on one of the field. Thank you once more.
    😎

    • @bugbytes3923
      @bugbytes3923  Рік тому +1

      Thanks a lot! I'm not sure about django-select2 in this example, but could look into that in a future video perhaps.

  • @DenisCardosoTutor
    @DenisCardosoTutor Рік тому

    Great tutorial. Is there a way to does not show the "submit all" if there is no form to submit ?

  • @marcoroose9973
    @marcoroose9973 7 місяців тому

    Very nice! But what about form errors?

  • @AliHassan-wc6nb
    @AliHassan-wc6nb Рік тому

    Best thing you did ma'am, can we validate all Input value at once while sending all forms at once. . Like all debits must be equal to total credits. Hope you got my point.

    • @trosgate
      @trosgate Рік тому

      In the widget, I think we can specify required=True to ensure that any form added is required. Htmx can be used to validate as well

  • @umrana5946
    @umrana5946 8 місяців тому +1

    thanks alot

  • @iniasderoeck1345
    @iniasderoeck1345 6 місяців тому

    Could you a video on the htmx with django CBV and more advanced relations instead of 1 FK. I have a project im really struggling with... Kind regards

  • @Igor160594
    @Igor160594 9 місяців тому

    you are the best

    • @bugbytes3923
      @bugbytes3923  9 місяців тому

      Thanks a lot, appreciate the comment!

  • @asqarsakenov
    @asqarsakenov 10 місяців тому

    How to make drop-downs which can fetch only the distinct values from psql? And next drop down in one row should depend on values of the previous choice and etc. I have to filter up the product price based on 4 filters like in excel and then fetch the corresponding price from DB to form an invoice. Thanks in advance!

  • @tofuman9526
    @tofuman9526 8 місяців тому

    I wonder. Would you build an app like Typeform with HTMX?
    Conceptually it seems like SPA approach is more suitable, just because it seems easier to build out.
    Even the display of the forms themselves, which in Typeform may include some logic, I.e rendering different forms acocording to answer provided…

  • @eduardsanchez6962
    @eduardsanchez6962 Рік тому

    greate tutorial OMG, just a question can this works with forenkyes, like add multiples instance of phone number of one person??

  • @joey4uandme
    @joey4uandme 7 місяців тому

    Can this be used for a single field in a model? For example. You use htmx to display a field in a model on a form only when another model field choice is selected.

  • @johnsonwambiru8497
    @johnsonwambiru8497 Рік тому

    life saver thanks

    • @peterevance
      @peterevance Рік тому

      Hello Johnson,
      What are you developing? 😅.

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thanks!

    • @johnsonwambiru8497
      @johnsonwambiru8497 Рік тому

      @@peterevance a system for managing invoices and delivery notes so i need a way to add multiple items and save them at a go

    • @peterevance
      @peterevance Рік тому

      @@johnsonwambiru8497 Ah , I see.
      @BugBytes had a video on something like that too. Something like Form Wizard tutorial.

  • @aafan.kuware
    @aafan.kuware 7 місяців тому +1

    🎉🎉🎉

  • @dodokwak
    @dodokwak Рік тому +1

    Thx.

  • @lordAvatar
    @lordAvatar Рік тому

    Hej BugBytes, great vid as always.
    I can't seem to find your repo for this one, am I being dumb/crazy?

  • @rokibulhaque1673
    @rokibulhaque1673 Рік тому

    Hi, Can you please share a tutorial for nested form using Django & HTMX...!!!

  • @amine63404
    @amine63404 9 місяців тому

    I am struggling with something, can you help please.
    How do we deal with forms errors.
    I am able to show them, but not able to remove them, because of when the form is valid, it's adding a new line but of course not removing the htmp errors tags.

  • @smartjoetechnologies
    @smartjoetechnologies Рік тому

    Thanks sir

  • @VTym-tk8qr
    @VTym-tk8qr Рік тому

    Hello. Thanks for the video lesson. As always, everything is at the highest level.
    Could you show how to complete the following task: a block with comments under the post, with sub-levels (replies to comments) and a separate block that adds up the number of comments. Thank you.

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Thanks!
      That's an interesting suggestion. Will add to the list, but it would require a new video and some prep.

  • @xVeraldi
    @xVeraldi Рік тому

    Would you be able to replace the Cancel button with an icon and have the same result using hx-on attribute?

    • @bugbytes3923
      @bugbytes3923  Рік тому +1

      Absolutely! Any icon with an hx-click trigger attached to it will work.

  • @ewyg
    @ewyg Рік тому

    which one should I use? hyperscript or alpinejs...? seems like alpinejs is more popular and mature?

    • @bugbytes3923
      @bugbytes3923  Рік тому

      Both are great choices. Alpine is probably more popular and mature, though.

  • @prezlamen
    @prezlamen 3 місяці тому

    Do you have source code of this app on git? I struggle to recreate this without error.

  • @airborne.images
    @airborne.images 10 місяців тому

    I love your videos, but I can't get this one to work. When I click add, it duplicates the entire page with the h1 title and the green add button...

  • @frameff9073
    @frameff9073 Рік тому

    thank

  • @prezlamen
    @prezlamen 4 місяці тому

    Can this be done in flask?

    • @bugbytes3923
      @bugbytes3923  4 місяці тому

      It could be done in Flask, with a few alterations - switch the Django forms with WTForms, for one.
      flask.palletsprojects.com/en/3.0.x/patterns/wtforms/
      All the HTMX stuff can be done with Flask in a very similar manner.

    • @prezlamen
      @prezlamen 4 місяці тому

      @@bugbytes3923 Thank you! If I can suggest, try to increase font size for UA-cam.

  • @dimasarestu2043
    @dimasarestu2043 Рік тому

    HTMX with django is really good, but how to validation all form, which if one form fail all form fail submit too

  • @albyunni8211
    @albyunni8211 Рік тому

    This code is the one i am looking . can i get the code

  • @JishnuDedeepya
    @JishnuDedeepya 11 місяців тому

    How to get single submit button for all multiple forms to submit to the database

    • @bugbytes3923
      @bugbytes3923  11 місяців тому

      There's a "Submit All" button in the latter part of this video I think, to show how to submit all the forms on the page.

    • @JishnuDedeepya
      @JishnuDedeepya 11 місяців тому

      Submit all button is not working for my multiple orders to submit on click

  • @carloseduardovieiramartins6102

    Its possible tô make for example, a tree level form, with a product , color and sizes variants to submit ALL together and get the fk for each one?

  • @dglebable
    @dglebable 6 місяців тому

    Can you provide the source code you have created?

  • @shivavsk6178
    @shivavsk6178 Рік тому

    Can you share the source code for this

    • @dglebable
      @dglebable 6 місяців тому

      Was there a reply to this request for code?

  • @catalinim4227
    @catalinim4227 Рік тому

    why not use one form with multiple rows 🧐

  • @alexforget
    @alexforget 10 місяців тому

    that repo is all broken, the code hasn't been updated for 3 year and is no longer working with django

  • @dstrelnikov
    @dstrelnikov 6 місяців тому

    man you do great tutorials, but can't understand how "div" element became to be "dev" in pronunciation, same for "file" -> "fail"

    • @bugbytes3923
      @bugbytes3923  6 місяців тому

      Thanks! Sorry, the Scottish accent is quite particular about these things.

  • @umairsarwar7472
    @umairsarwar7472 Рік тому