Squiz Seemingly Ignoring Simple Validation Rules


(Lewis) #1

Anyone got any idea why Squiz 5.5.3.3 seems to ignore Simple Validation Rules (required field, for example) and skips straight to Complex Validation Rules.

In my case, I’ve got:

  1. a simple validation rule (required field)
  2. two complex validation rules (at least 10 characters in length and a regular expression to look out for email addresses for GDPR)

Both rules are attached to the same form field (a textbox comment field).

For some reason, when I submit the form, it skips over the required validation rule and the 10 characters rule and goes straight to the email one, presenting my custom error message.

Is this a bug?


(Lewis) #2

Solution was to change the Operator dropdown to Must NOT Match the Regular Expression. Might seem obvious but could swear I tried it before and it wasn’t working so changed it back.

Essentially the logic is then the value of the input Must NOT Match the Regular Expression in order for the error message to be avoided - i.e. the input must not contain an email address, for example.