Jump to content

Remove errors


Martijn Geerts
 Share

Recommended Posts

This POST here is a Formbuilder post, but it's not specific to Formbuilder as it's usefull for other API related errors.

What I want is remove "Missing required value" and add a custom error in. 

The only thing I can achieve is adding a new error on top of the error array.

$forms->addHookAfter('InputfieldForm::processInput', null, 'hookProcessInput');

function hookProcessInput(HookEvent $event) {
	$form = $event->object;
	
	$firstname = $form->get('firstname');
	
	if($firstname->error('Missing required value')) {
		// here the stuff I don't get
	}
}
Link to comment
Share on other sites

Why remove? Why not just hook before and do what you need to do?

Also I think you could leave it not required and add that via js or css.

Also you could try hook before on inputfieldText directly.

BTW your if() adds a error.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...