When I'm developing I don't always want to validate my forms via Symfony2's validator.
(I'm not talking about turning off HTML5 validation.)
Is there a quick way to disable and re-enable form validation?
For this, you can set the validation_groups
option to false:
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'validation_groups' => false,
));
}
Hope this will work.
These links will help: temporarily disabling validation
Skip validation if sibling (checkbox) field contains 'false'
try this
you can handle this using jquery
for disable form validation?
$(fromId).removeAttr("novalidate");
and
for remove form validation?
$(fromId).attr("novalidate");