You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
Remove one element during runtime using $form->remove('name');
Render, submit and validate the form
Result:
Validation will fail because the inputfilter (which is required by default) still remains in the form. However, as the element itself doesn't exist anylonger, no message will be generated ($form->getMessages(); will be empty in case of no other valdiation errors).
@bakura10 Yeah agree, but you think the match must not have to exist ?
Validation group is used to limitied the validation (like an update), not for a normal use case, no ?
The form and the input filter are separate objects. To keep them informed of the state of one another requires further coupling. This is precisely why validation groups were created -- if you're changing the set of elements in the form, then you should also set the validation group so that it only includes what you plan to validate.
Steps to reproduce:
$form->remove('name');
Result:
Validation will fail because the inputfilter (which is required by default) still remains in the form. However, as the element itself doesn't exist anylonger, no message will be generated (
$form->getMessages();
will be empty in case of no other valdiation errors).Workaround:
Also remove the inputfilter:
The text was updated successfully, but these errors were encountered: