Skip to content

Instantly share code, notes, and snippets.

@travist
Created June 20, 2019 15:49
Show Gist options
  • Save travist/c7b5ea52bb246631bd767acb5b31faf7 to your computer and use it in GitHub Desktop.
Save travist/c7b5ea52bb246631bd767acb5b31faf7 to your computer and use it in GitHub Desktop.
Override Validation Components
import BaseEditValidationForm from 'formiojs/components/base/editForm/Base.edit.validation.form';
import _ from 'lodash';
const customValidation = _.cloneDeep(BaseEditValidationForm[4]);
customValidation.components.splice(3, 1);
Formio.builder(document.getElementById('builder'), {}, {
editForm: {
textfield: [
{
key: 'validation',
components: [
{
key: 'custom-validation-js',
components: customValidation.components
}
]
}
]
}
}).then(function(builder) {
builder.on('saveComponent', function() {
console.log(builder.schema);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment