Function I should use between Checkbox and Button on Wix

As title, I working on a simple page on Wix, and it is about users have to click on the checkbox to agree the term of use of the site before they press "continue" button. I am currently stuck, and the code I have is as follows Please let me if there is any solution to it.

$w.onReady(function(){

let isChecked = $w("#checkbox1").checked; 
let isRequired= $w('#checkbox1').required; // true

if(isChecked === false)
{
    $w('#button1').disable;
}else{
    $w("#button1").enable;
}
});

99 thoughts on “Function I should use between Checkbox and Button on Wix”

  1. you can disabled continue button by default on page load and add click event listener to catch checkbox click you should try below code.`$w.onReady(function(){
    $w(‘#button1’).disable;

    let isChecked = $w("#checkbox1").checked;
    let isRequired= $w(‘#checkbox1’).required; // true

    $("#checkbox1").click(function(){
    $w(‘#button1’).disable;
    });`

    Reply
  2. You need to add an EventListener to the checkbox so that the isChecked variable will update when the checkbox value changes.

    I’m not too familiar with JQuery but in vanillaJS you can use something like.

    const checkbox = document.getElementByID('checkbox1');
    checkbox.addEventListener('change', ($event) => {
      isChecked = $event.target.checked;
    });
    
    Reply
  3. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate!
    He always kept chatting about this. I will forward this page to him.

    Pretty sure he will have a good read. Thank you for sharing!

    Review my webpage … aaa1188

    Reply
  4. You have made some really good points there. I checked
    on the internet for more information about the issue and found most individuals will go along with your views on this website.

    My web-site; lpe88apk download (Gertrude)

    Reply
  5. I know this if off topic but I’m looking into starting my own blog
    and was curious what all is needed to get set up? I’m assuming having
    a blog like yours would cost a pretty penny?
    I’m not very web savvy so I’m not 100% certain.
    Any recommendations or advice would be greatly appreciated.
    Appreciate it

    Here is my homepage :: http://amhley.org

    Reply
  6. I needed to create you the very little note just to thank you so much over again for the lovely tricks you’ve
    contributed here. This has been certainly seriously generous with people like you to make unreservedly just what some people
    could have offered for an e book to get some bucks
    for their own end, chiefly given that you might have done it in the event
    you desired. The pointers as well worked as the good way to know that most people have the same eagerness much like my
    personal own to find out whole lot more with respect
    to this matter. I think there are lots of more enjoyable instances
    up front for those who browse through your blog post.

    Also visit my web blog: bgmobile.eu

    Reply
  7. I intended to compose you this bit of word in order
    to say thanks as before relating to the extraordinary pointers you have shown on this website.
    It has been quite particularly open-handed with people like you to deliver extensively what many of us would have supplied for
    an ebook to help make some bucks on their own,
    primarily given that you might have tried it if you decided.
    These pointers as well acted to become a easy way
    to be aware that many people have a similar dream the same as mine
    to know the truth more when it comes to this issue.
    I am sure there are lots of more enjoyable instances ahead
    for individuals who take a look at your site.

    Have a look at my webpage :: community.allthingsmarketplace.com

    Reply
  8. A fascinating discussion is worth comment. I think that you
    ought to publish more on this topic, it might not be a taboo
    subject but generally people don’t discuss such issues.

    To the next! Many thanks!!

    Reply
  9. I’m curious to find out what blog platform you are working with?
    I’m having some small security issues with my latest site and I would like to find something more risk-free.

    Do you have any recommendations?

    Reply
  10. Saya akan segera genggam rss Anda karena saya tidak bisa

    Ini adalah waktu sempurna untuk membuat beberapa rencana untuk masa depan dan
    sekarang waktu untuk berbahagia. Saya telah membaca posting ini
    dan jika saya bisa, saya ingin menyarankan Anda beberapa hal menarik atau saran .
    Mungkin Anda bisa menulis artikel berikutnya yang mengacu pada artikel ini.
    Saya ingin membaca lebih hal tentang itu!

    Feel free to visit my homepage … Game Joker388 (https://gameaco.com)

    Reply
  11. Saya telah menjelajah online lebih dari 3 jam hari ini, namun saya tidak pernah menemukan artikel menarik seperti milik Anda.

    It’s cukup berharga bagi saya. Secara pribadi , jika semua webmaster
    dan blogger membuat konten yang baik seperti yang Anda lakukan,
    net akan menjadi a jauh lebih berguna dari sebelumnya.

    Feel free to surf to my web site Download joker888

    Reply
  12. I believe everything posted made a lot of sense. However, think on this, suppose you added a little
    content? I am not suggesting your information is not good, but suppose you added a post title to possibly grab a person’s attention? I mean Function I
    should use between Checkbox and Button on Wix – JavaScript Help is kinda
    plain. You ought to glance at Yahoo’s home page and see how they create news
    titles to grab people to click. You might add a related video
    or a related pic or two to grab readers interested about what you’ve written. In my opinion, it might bring your website a little livelier.

    Reply
  13. It’s the best time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I want to suggest you
    some interesting things or tips. Perhaps you could write next
    articles referring to this article. I desire to read more things about it!

    Feel free to visit my web blog … Vernon

    Reply
  14. It is the best time to make some plans for the future and it’s time to be happy.

    I have read this post and if I could I want to suggest you some
    interesting things or advice. Perhaps you could
    write next articles referring to this article. I wish to read even more things about it!

    Feel free to surf to my web-site :: http://www.frvmuskie.com

    Reply
  15. Hi! Quick question that’s completely off topic.
    Do you know how to make your site mobile friendly?
    My web site looks weird when browsing from my iphone 4.
    I’m trying to find a template or plugin that might be able to correct this problem.
    If you have any suggestions, please share. Many thanks!

    Also visit my blog post freeholmes.com

    Reply
  16. I’m really enjoying the design and layout of
    your website. It’s a very easy on the eyes which makes it much more pleasant for
    me to come here and visit more often. Did you hire out a designer to create your theme?
    Fantastic work!

    Here is my homepage fahl.uk

    Reply
  17. Hi would you mind sharing which blog platform you’re working with?

    I’m looking to start my own blog in the near future but I’m
    having a hard time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and I’m looking for something completely unique.
    P.S My apologies for getting off-topic but I had to ask!

    Also visit my homepage :: http://www.hit-forum.info/

    Reply
  18. I liked up to you will obtain performed proper here.
    The sketch is attractive, your authored material stylish.
    however, you command get got an nervousness over that you wish be delivering the following.
    in poor health indisputably come further previously once more since exactly the same
    nearly a lot regularly inside of case you defend this hike.

    Feel free to visit my homepage – http://www.lifeadventureexplore.com

    Reply
  19. I am glad for commenting to let you be aware of of the extraordinary experience my friend’s child
    enjoyed browsing your site. She noticed too many things,
    which include how it is like to have an ideal teaching mindset to let a number of people without difficulty fully understand some complicated topics.
    You undoubtedly exceeded her expected results.
    Thank you for delivering such great, safe, edifying and even fun tips on that topic to Mary.

    Here is my web blog: http://www.aniene.net

    Reply
  20. Howdy! This post couldn’t be written any better!
    Looking through this post reminds me of my previous roommate!

    He constantly kept preaching about this. I most certainly will
    send this information to him. Fairly certain he’ll have a very good read.
    I appreciate you for sharing!

    My webpage :: ozarkstalk.com

    Reply
  21. I have to thank you for the efforts you’ve put in writing this blog.
    I really hope to see the same high-grade
    blog posts by you in the future as well.
    In fact, your creative writing abilities has motivated me to get
    my own blog now 😉

    Feel free to surf to my web site: illinoiszone.com

    Reply
  22. I enjoy you because of your own effort on this web page.
    My daughter takes pleasure in participating in investigation and
    it’s easy to see why. Most people learn all relating to the lively manner you produce practical guidance via this web site and
    even attract contribution from some other people
    on the issue plus our simple princess is actually becoming
    educated a great deal. Enjoy the remaining portion of the year.
    You are conducting a great job.

    Also visit my web site – http://www.groovyfreeads.com

    Reply
  23. Right here is the rіght site for anyone who really wants to understаnd this topiс.
    You realize a whole lott its almost hard to argue with you (not that I really woulld wan to…HaHa).
    You certainly put a freh spin on a sᥙbϳect that’s
    beеn written aboᥙt for decadеs. Excellent stuff, just
    wonderful! http://www.ognivo.ru/gb/

    Reply
  24. Simply wish to say your article is as astonishing. The clearness to your submit is simply great
    and i can suppose you are an expert in this subject.
    Fine with your permission allow me to clutch your feed to stay updated with forthcoming post.
    Thank you 1,000,000 and please keep up the
    enjoyable work.

    My page; equipifieds.com

    Reply
  25. I enjoy you because of all of your hard work on this web page.
    Ellie really loves working on investigations and it is easy to see why.
    My spouse and i learn all of the dynamic tactic you give effective things through this
    web site and in addition attract response from visitors about this content then our favorite princess has always
    been becoming educated a great deal. Take advantage of the
    remaining portion of the year. You are always doing a superb job.

    Visit my web page: http://www.ptfang.com/bbs/forum.php?mod=viewthread&tid=38938

    Reply

Leave a Comment