Additional S/Side Validation Type
I recently had a need to include validation on a page using 2 paint options, where a selected (contrasting) colour should not match a selected (main) colour.
Noticed that there was a 'Like Entry' validation type which seemed to be the opposite of what I wanted.
Unable to find any parameters I could change, I created a new validation rule.
Using 'Like Entry' as a start point I created a 'Not Like Entry' validation type, like so...
function WAValidateNLE($value1,$value2,$required,$number) {
$WAFV_ErrorMessage = "";
$isValid = true;
if ($value1 == $value2 || ($required && $value1 == "")) {
$isValid = false;
}
if (!$isValid) {
$WAFV_ErrorMessage .= ",".$number;
}
return $WAFV_ErrorMessage;
}
May be a use for this generally, unless someone tells me that I could have done this with the existing rule, but by changing the parameters ?!