How can I make a checkbox mandatory on Dawn Theme 2.0 contact page?

Hello,

I’m trying to add a very simple checkbox to the Dawn Theme 2.0 contact page in order to make the acceptance of Terms&Conditions mandatory. So far I’ve added this code:


  

    
      
    

right before {%- endform -%}

But I really cannot find a way to use a javascript to make that checkbox mandatory! Where should I put it or there’s a workaround to this? I’ve also tried to use a but nothing, it doesn’t work!

Thanks for all the help you could provide

@CMwebmaster , keep the same code just add one attribute to make the checkbox required. Please see below source code.


  

    
      
    

1 Like

Hi there,

Sorry to jump on your topic but I am working on something similar and got stuck. I am trying to add a mandatory checkbox to the product page where customer has to agree to 2 conditions before they can add the product to their Cart. I just switched to the Dawn theme today and cannot figure out how to add the code to the new theme.

I previously used the Debutify theme and this is what it looked:

Customer will get a notification if they don’t select the checkboxes (like shown above).

Can you point me in the right direction as to where to add the code so it will look like this in the Dawn theme too?

I really appreciate your time and guidance with this!

Thank you.

Thanks very much. I was wondering about harder things to do that I missed the semplicity of “required” tag.

Yes I can understand your problem, I solved it with Terms&Conditions plugin.

I really do not understand why newest themes like this are still missing these basic features. The most important thing to do is also to archive all the consensus given by the custmers in a db, in order to comply with all the new regulations in matter of privacy worldwide.

Hi @mielemoda ,

Yeah, I got your point. can I have the store URL?

And one more question, do you have good liquid knowledge?

1 Like

Sorry, in my excitement forgot to add the link ..
https://www.mielemoda.com/

Since I wrote to you the other day, I switched back to my old theme (Debutify). Will it help if I make Dawn the active theme?

Thank you so much!

Yeah, I got it. Yes, it’s required the new theme to check the issue. and if possible also show me the code of that dawn theme so I can guide you well. @mielemoda

Just switched to Dawn. Now it’s active in my shop. Let me grab that code from my Debutify theme.

Here is the code:

{% endcomment %}

{% if mirza_collection %}

I understand that my product purchased is Made-to-Order and not yet in physical stock. (Please refer to the Production Time within the product description below).

I also understand that it is recommended to purchase a Made-to-Order item for an event that is at least 2 weeks after the advertised estimated Production Time.

{% endif %}

Mirza was the name of the person who helped me with this issue the first time around therefore his name is all over the code lol

@Akibhusen

Hahaha. most developers used this way to recognize their own code :face_with_tongue:


{% endcomment %}

{% if mirza_collection %}

{% endif %}

can you please replace the code with above and check.

Hi,

I’m trying to accomplish something similar to the product page. where would this code be inserted?

thx

monica

HI @monica22 ,

can you please brief me on where you want to add? Also, share the URL of the store so, I can check and let you know where to add the code.

I haven’t been able to get this to work for my store. I am using the Sense theme 2.0, could you start the coding process from the beginning for me?

Hi again,

revisiting this convo we had quite some time ago. I am now using Dawn theme full time and still haven’t figured out where to place the required check box code. Could you please guide me in the right direction when you get a moment?

I really appreciate your time.