Custom Validation didn't work with error labels.

A new feature was added in 588b9bc commit/patch that allowed a wrapping `<label>` tag to obtain a 'error' class. Without this, you couldn't use `prefix`/`postfix` and show an error message.

Unfortunately, it only worked for pattern validation. I just added in the necessary code to make it work for Custom Validation.