hmac validation and required custom fields

GeorgeInActonGeorgeInActon Member
in Help edited June 2014
I can't seem to get required custom product fields to be required. I can add the product to the cart without error even though they're empty. I tried two different ways:
<input type='text' name='entry_number||10bd901c4916b64b488756782530e64b50d552fa6d70535d54169b61f5390761||open' id='entry_number||10bd901c4916b64b488756782530e64b50d552fa6d70535d54169b61f5390761||open' value='' maxlength='4' style="width: 125px;" class="fc_required">
<label class="fc_error" style="display:none;" for="entry_number||10bd901c4916b64b488756782530e64b50d552fa6d70535d54169b61f5390761||open">* required</label>

and
<input type='text' name='entry_number||10bd901c4916b64b488756782530e64b50d552fa6d70535d54169b61f5390761||open' id='entry_number||10bd901c4916b64b488756782530e64b50d552fa6d70535d54169b61f5390761||open' value='' maxlength='4' style="width: 125px;" class="fc_required">
<label class="fc_error" style="display:none;" for="entry_number">* required</label>

What am I doing wrong?
Comments
  • fc_adamfc_adam FoxyCart Team
    @GeorgeInActon,

    We don't have any validation of your add to cart fields, which is why you're not seeing any errors in the add to cart. If you want to make a field required, you'll need to add in your own validations there to make that so. To do that, you'd want to make use of the 'preprocess' event queue which you can read more about here: http://wiki.foxycart.com/static/redirect/javascript
  • Thanks. I was able to get it to work with the instructions on that page.
Sign In or Register to comment.