contributte / live-form-validation

:no_entry: Nice client-side live form validation for Nette Forms.
https://contributte.org/packages/contributte/live-form-validation.html
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Added pattern for FileUpload & MultipleFileUpload #47

Closed jzaplet closed 6 years ago

jzaplet commented 6 years ago

Nette/Forms supports PATTERN RULE for $form->addUpload(), but live-form-validation not.

$form->addUpload('file')
  ->setRequired(FALSE)
  ->addRule(Form::PATTERN, 'Image must have extension (.jpg or .png).', '.*\.(png|jpg)');

And it also works with $form->addMultiUpload(), but there we're waiting for merge PR (https://github.com/nette/forms/pull/192).

f3l1x commented 6 years ago

Thank you.