App reviews, troubleshooting, and recommendations
Hi there
I created a Shopify App with theme app extension framework to add functionality on the product page. My problem is I wanted to add some textbox that required to fill before submitted (before add to card or buy). I have tried to add required="required" and aria-hidden. Please see the code bellow
<div class="field mb-5">
<input type="text" id="customText" value="" required="required" aria-required="true" class="keyboardInput field__input" dir="rtl" lang="ar" name="properties[Text]" form="product-form-{{ section.id }}">
<label for="customText">
<span aria-hidden="true">*</span>
</label>
</div>
The required not working, I can add to card or just buy with leave it blank to the input type text. Any idea?
Thank you
Solved! Go to the solution
This is an accepted solution.
I have found the solution as below
<script>
document.getElementById("product-form-{{ section.id }}").noValidate = false;
</script>
This is an accepted solution.
I have found the solution as below
<script>
document.getElementById("product-form-{{ section.id }}").noValidate = false;
</script>
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025