VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: terp on April 13, 2012, 16:36:58 PM

Title: Validate Custom Fields Using Regex/PHP?
Post by: terp on April 13, 2012, 16:36:58 PM
I figured out how to setup the custom fields for my products and went the 'Please Select a ...' route, adding a default field with the 'Please Select...' language and then a few option fields.

I am wondering if there is a way I am overlooking (without having to add the functionality to the core) to validate these fields? Like add a 'not equal' validation OnSubmit that ensures they changed the default 'Please Select' and actually chose an option on the dropdown?

Otherwise, some could overlook the field and fire it off without ever selecting an option....
Title: Re: Validate Custom Fields Using Regex/PHP?
Post by: terp on April 15, 2012, 15:36:43 PM
Guess not.

How do you guys handle this potential issue?
Title: Re: Validate Custom Fields Using Regex/PHP?
Post by: terp on April 24, 2012, 17:38:09 PM
Okay, one more validation issue that could be fixed with field-level validations:

The shipping address/billing address fields during checkout (edit_address.php, for example).

While it does seem to fire a notempty validation, I can enter "Terp" for all fields and submit the form...and given that the core uses "--Select--", the conditional dropdowns pass validation, also, since they have a default value.