Validation Rules on Variables?

brhaynes75brhaynes75 Member
in Bugs & Feature Requests edited February 2008
My shopping cart has a drop-down menu that has, say, sizes. The top of the list is a valueless option with the title "--choose size--"

BUT, if someone just hits "Add to Cart," and doesn't enter a size, then the shopping process proceeds as usual. There are no validation rules that can be applied. Of course, I did apply a basic validation.js validation rule, and it comes up "Please assign a size," but after hitting "ok" the modal window still pops up and the customer can continue without ever making a change to the size.

What can I do to ensure a variable is selected before completing the process?

Thanks in advance,
Brad
Comments
  • lukeluke FoxyCart Team
    Hey Brad. I know our docs REALLY need help... we're getting there. This is probably what you're looking for:

    http://wiki.foxycart.com/docs:json

    Check out fc_PreProcess(). You can have it call your validator and if it doesn't like what it got back, just return false.
Sign In or Register to comment.