Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: HTML standard 'required' attribute broken in OS.2

HTML standard 'required' attribute broken in OS.2

LetsGetDigital
Shopify Partner
53 0 54

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
53 0 54

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
7450 657 1565

@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


LetsGetDigital
Shopify Partner
53 0 54
Lol
Let's Get Digital (dot net)