contributte / forms-multiplier

:repeat: Form multiplier & replicator for Nette Framework
https://contributte.org/packages/contributte/forms-multiplier.html
MIT License
26 stars 21 forks source link

Exception of validation #30

Closed jAKErCZ closed 6 years ago

jAKErCZ commented 6 years ago

Hi, I should ask how can I turn off or bypass that when adding a new line using $multiplier->addCreateButton('Add'); will not validate my entire form?

Something like the classic form of the function? ->setValidationScope()

MartkCz commented 6 years ago

Try:

$multiplier->addCreateButton('Add', 1, function (WebChemistry\Forms\Controls\Submitter $submitter) {
    $submitter->setValidationScope([]);
});

I push commit soon (max 30 minutes), which will allow:

$multiplier->addCreateButton('Add')
    ->setNoValidate();
MartkCz commented 6 years ago

You can use $multiplier->addCreateButton('Add')->setValidationScope(...) too