Get checkbox values with vanilla JavaScript

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

КОМЕНТАРІ • 10

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

    Thanks for watching!
    👉 Source code with live example: openjavascript.info/2022/12/13/get-checked-checkbox-values-from-html-form-with-javascript/

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

    Excellent short and straight to the point tutorial. Thanks

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

    You just helped me with an assignment where I had to create a site for a pizzeria. The toppings had to be created in a "checkbox" field then I had to print the results on the HTML page. Your video worked!

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

      That's a really cool use case. Glad this video helped you to do it!

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

    Thank you; this is very helpful. Currently working on a small app with checkboxes, where I want to be alerted to which items are not checked off if I try to submit. I think the second method might be a good solution.

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

      I agree, I think the best approach in your case would be to adapt the second solution to query the second value in each array when a user clicks submit.
      Good luck with your app!

  • @fandaancheung
    @fandaancheung 24 дні тому

    thx so much, help me a lot

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

    Subscribed and liked! 👍

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

      Thanks and welcome aboard this JavaScript learning train 🚂

  • @TheMorrogoth
    @TheMorrogoth 2 місяці тому

    I've been working on an electron app for some time now (just something to learn with) and I've been trying to figure out how to save checkboxes and effects on a div (IE: visible or none) and storing those within localStorage. Is there a way to use the checkbox clicking event as the "listener" event instead of having to use a button to submit?
    IE: If the user checks a box then it would hide a div and then save that choice in localStorage as it is being checked.
    The reason I ask this is because I'm creating the HTML using JS literal templates and I can't run functions within the template as it stands now.