A space to discuss online store customization, theme development, and Liquid templating.
Dawn theme in OS2.0
Customer notes field.
If you add the standard HTML attribute 'required' it is ignored (broken by the poorly constructed javascript).
Response from support:
Our Technical Team has gotten back to me and they have suggested using the Shopify UI Elements Generator tool to generate the HTML and Liquid code to add to your cart page.
This tool was created by the platform to simplify the process of adding customer UI elements. This also includes requiring customers to fill out your form field first before reaching checkout.
"simplify the process" - LOL! - what could be simpler than adding 'required' to the HTML!
I pasted the code generated by the link provided by support. You can see the 'required' attribute and a class called "required" was also applied.
<p class="cart-attribute__field">
<label for="how-did-you-hear-about-us">How did you hear about us?</label>
<textarea required class="required" id="how-did-you-hear-about-us" name="attributes[How did you hear about us?]">{{ cart.attributes["How did you hear about us?"] }}</textarea>
</p>
Neither work. The field can still be bypassed when blank.
OS2.0 is a joke.
@LetsGetDigital wrote:If you add the standard HTML attribute 'required' it is ignored (broken by the poorly constructed javascript).
OS2.0 is a joke.
What the javascript or possibly malformed html in one theme does has nothing to with the features of the underlying OS2.0 architecture for themes to use.
Make sure this bit ">{{ cart.attributes["How did you hear about us?"] }}</textarea>" isn't outputting empty space content as then there is content in the textarea fulfilling the required requirement.
And that the code is inside a form element, and the submission happens through a submit button.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org