News:

Support the VirtueMart project and become a member

Main Menu

Validate Custom Fields Using Regex/PHP?

Started by terp, April 13, 2012, 16:36:58 PM

Previous topic - Next topic

terp

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....

terp

Guess not.

How do you guys handle this potential issue?

terp

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.