If you use a custom view transformer, implement the matching transformer on the JavaScript side so validation receives the same normalized value.
For a PHP view transformer such as App\Form\DataTransformer\MyTransformer,
create a JavaScript constructor with the namespace separators removed:
<script type="text/javascript">
function AppFormDataTransformerMyTransformer() {
/**
* Extra options from the PHP transformer can be copied into this object.
*/
this.extraOption = '';
/**
* This method is required.
* It should return the value that will be validated.
*/
this.reverseTransform = function(value, model) {
// Compose the real value here.
return value;
};
}
</script>