Skip to content

Instantly share code, notes, and snippets.

@somatonic
Last active December 16, 2015 14:40
Show Gist options
  • Save somatonic/5450700 to your computer and use it in GitHub Desktop.
Save somatonic/5450700 to your computer and use it in GitHub Desktop.
turn off html5 validation in form builder
<?php
// in form-builder.inc
$forms->addHookBefore('FormBuilderProcessor::render', null, 'hookRenderForm');
function hookRenderForm(HookEvent $event) {
$processor = $event->object;
$form = $processor->getInputfieldsForm();
$form->attr('novalidate', '1');
}
// or using InputfieldForm
$forms->addHookBefore('InputfieldForm::render', null, 'hookRenderForm');
function hookRenderForm(HookEvent $event) {
$form = $event->object;
$form->attr('novalidate', '1');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment