1

Can anyone give me a suggestion on how to make a Product Text Modifier required in Store. I know this option is available for the Checkout Tag with the "Required" parameter, but not for the Product Tag.

I have a number of text modifiers that need to be filled out before the customer can add the item to their cart. Is there a better way of doing this in Store instead of having to write Javascript code to test the fields.

EE 2.5.5 Store 1.6.2

thanks, Shannon

3

There isn't any server-side error handling on the add to cart form, so there isn't any way to make text modifiers required (aside from the fact that modifiers normally vary from product to product, which would make it hard to specify in the template).

The best and easiest way to do this is using Javascript, as you suggested. A simple form submit function would be enough, though if you want you could get really fancy with your form validation/error handling.

$("#submitbtn").click(function() {
    if ($("#textfield").val() === "") {
        alert("Please enter a value!");
        return false;
    }
});
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.