Personalized checkout and custom promotions with Shopify Scripts
Hi all,
I have added two custom field on my cart page "your name" and "your contact no." and it is supposed to be a required field.
When I add the codes to the main-cart-items.liquid file, the required fill works. It will not allow me to proceed to the checkout page if i did not fill in the fields.
However, I would prefer the "your name" and "your contact no." to appear below the subtotal which I had to add the codes to the "main-cart-footer.liquid" file instead. After adding the custom field box here, the "required" function is not working. I can proceed to the checkout page without filling in these two fields.
This is how my code looks like:
<p class="cart-attribute__field"><P STYLE="text-align:right", style="font-family: harmonia sans">
<label for="your-contact-no">Your Contact No.</label>
<input required class="required" id="your-contact-no" type="text" name="attributes[Your Contact No.]" value="{{ cart.attributes["Your Contact No."] }}">
</p>
Does anyone knows how to fix this issue?
Remove novalidate attribute from the the form tag
Hi Asad24,
Where do I find the novalidate attribute?
The code is the only thing I got from the custom field generator site.
User | RANK |
---|---|
2 | |
2 | |
2 | |
2 | |
2 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023