I'm migrating a store from EE2 to EE3, updating the Expresso Store version at the same time. I'm trying to validate my checkout form inline. In Store 3 whilst most fields are validating correctly (Name, address etc), I can't get inline error messages to work for either the order_email form element or the password form element (though the confirm password box does fire an error).

Similarly in the doc's it says you can use the Expression engine validation rules including regular expressions, but I can't get these to work AT ALL (not even basic required) (https://www.exp-resso.com/docs/checkout_tag.html#rules_field_name_rule)

This is my checkout tag:

                    {exp:store:checkout
                        form_id="checkout-form"
                        form_class="checkout-form"
                        next="/store/checkout3"
                        require="first_name|last_name|address1|city|postcode|country|phone|password|order_email"
                        error_handling="inline" 
                        error_delimiters='<p class="col-12 error-message">|</p>'                
                        secure="yes"}

but I've tried using these lines both along with and without the required field above to no avail.

rules:first_name="trim|required|min_length[1]|max_length[30]|regex_match[/^[A-Za-z0-9!_., \&\#\-]+$/]"
rules:last_name="trim|required|min_length[1]|max_length[30]|regex_match[/^[A-Za-z0-9!_., \&\#\-]+$/]"
rules:address1="trim|required|min_length[3]|max_length[35]|regex_match[/^[A-Za-z0-9!_., \&\#\-]+$/]" 
rules:address2="trim|min_length[3]|max_length[35]|regex_match[/^[A-Za-z0-9!_., \&\#\-]+$/]"    
rules:address3="trim|required|min_length[3]|max_length[35]|regex_match[/^[A-Za-z0-9!_., \&\#\-]+$/]" 
rules:postcode="trim|required|min_length[1]|max_length[15]|regex_match[/^[A-Za-z0-9!_., \&\#\-]+$/]"
rules:billing_phone="required|min_length[1]|max_length[15]"
rules:email="required|min_length[1]|max_length[100]|"

I feel like I must be missing something really simple here. Any pointers much appreciated!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.