How do I make the Name and Subject (Comment) field required in the Contact Form? Currently only Email field is required.
Thanks in advance
A user seeks to make the Name and Subject (Comment) fields required on the default Contact Us form in Shopify’s Dawn theme version 12.0.0, as currently only the Email field is mandatory.
Solutions Provided:
required attribute to input fields in the theme’s code filescontact-form.liquid in theme files<div class="contact__fields"><input> tag for the desired fieldsResources:
Outcome:
The original poster confirmed the solution worked and achieved the exact result needed.
Open Question:
Another user asks how to display error messages for these fields in the same way as the email field.
How do I make the Name and Subject (Comment) field required in the Contact Form? Currently only Email field is required.
Thanks in advance
Hey @Deb0007
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Hi @Moeed ,
Thanks for your prompt response. My site URL is https://aparelz.com/ and the password is “chieth”.
Thanks,
Deb0007
Hey @Deb0007
You just have to add “required” in your input fields from the code files and then it should be good. If you want I can send a collaborator request and can do that for you. Let me know if you require further assistance!
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
@Deb0007 I made a video where I showed how you can make the Name and Comments field as required in the Dawn theme. Please watch the video tutorial here https://www.youtube.com/watch?v=0LI7iyHABpo
Hi @Deb0007 , in your theme files go to contact-form.liquid
Then search for
Hi @KabirDev ,
I found your video very helpful for me. It described each step so clearly. Now I got the exact result I needed.
Friend, a bunch of thanks for you.
Thanks,
Deb0007
I have a question, what should be the changes in order to display error the same way as the email fields?