HTML standard 'required' attribute broken in OS.2

LetsGetDigital
Shopify Partner
34 0 44

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!

 

 

Let's Get Digital (dot net)
Replies 3 (3)
LetsGetDigital
Shopify Partner
34 0 44

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.

Let's Get Digital (dot net)
PaulNewton
Shopify Partner
4878 413 1054

@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.

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
LetsGetDigital
Shopify Partner
34 0 44
Lol
Let's Get Digital (dot net)