You can read here about data transformers. If you already have a custom composite field with the custom Acme\DemoBundle\Form\DataTransformer\MyTransformer view transformer - you should implement it on JS side to prepare the value for the JS validation:
<script type="text/javascript">
function AcmeDemoBundleFormDataTransformerMyTransformer() {
/**
* Some extra option, defined in your transformer. It will be filled from your php class
*/
this.extraOption = '';
/**
* This method is required
* should return the resulting value
*/
this.reverseTransform = function(value, model) {
// Some actions to compose the real value
return value;
}
}
<script/>