support

help! need to validate product options during checkout

Started by wshtek, April 24, 2017, 10:48:08 PM

Previous topic - Next topic

wshtek

I have a product built with several selectboxes and options, most set to require a value. instead of defaulting to any particular option value or having a blank value, i have added the option value 'select', to indicate that the user needs to select a value. I have tried several regex expressions to test for the word 'select' (in case the user made no actual selection) and nothing seems to work - using regex seems to always bring up an exception with the option i am testing after 'checkout' is selected. is there any possible way to check for the word 'select' and provide an indication that the user needs to select a value for any particular selectbox when they try to checkout? any help with this would be greatly appreciated !

wshtek

with little experience in regular expressions and after much trial and error, i found a solution.

the default list option is 'select...'

the regexp is: /^(?!...$)/

so, if any option returns  '...', the user is prompted for a value. maybe i made this more difficult than need be, but it works :)

Basara



Forum Rules Code of conduct
AbanteCart.com 2010 -