diff --git a/Form/Extension/FormExtension.php b/Form/Extension/FormExtension.php index 21bd7b9..3b40913 100644 --- a/Form/Extension/FormExtension.php +++ b/Form/Extension/FormExtension.php @@ -5,7 +5,7 @@ use Fp\JsFormValidatorBundle\Form\Subscriber\SubscriberToQueue; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; /** * Class FormExtension @@ -39,7 +39,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) /** * @param OptionsResolverInterface $resolver */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array('js_validation' => true)); } @@ -53,4 +53,4 @@ public function getExtendedType() { return 'form'; } -} \ No newline at end of file +} diff --git a/Resources/public/js/FpJsFormValidator.js b/Resources/public/js/FpJsFormValidator.js index 2f346aa..cc4dfee 100644 --- a/Resources/public/js/FpJsFormValidator.js +++ b/Resources/public/js/FpJsFormValidator.js @@ -807,6 +807,9 @@ var FpJsFormValidator = new function () { * @param {FpJsFormElement} element */ this.getErrorPathElement = function (element) { + if (element.type == 'repeated') { + return this.findDomElement({id: element.id+'_first', name: element.name+'_first'}).jsFormValidator; + } if (!element.bubbling) { return element; } else { diff --git a/Resources/public/js/fp_js_validator.js b/Resources/public/js/fp_js_validator.js index d362486..5d002f1 100755 --- a/Resources/public/js/fp_js_validator.js +++ b/Resources/public/js/fp_js_validator.js @@ -807,6 +807,9 @@ var FpJsFormValidator = new function () { * @param {FpJsFormElement} element */ this.getErrorPathElement = function (element) { + if (element.type == 'repeated') { + return this.findDomElement({id: element.id+'_first', name: element.name+'_first'}).jsFormValidator; + } if (!element.bubbling) { return element; } else {