contributte / live-form-validation

:no_entry: Nice client-side live form validation for Nette Forms.

Home Page:https://contributte.org/packages/contributte/live-form-validation.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timing of setting custom options

rolandtoth opened this issue · comments

I load live-form-validation by another JavaScript and I can't reliably control when this happens, so it's hard to set options after the script is loaded (using LiveForm.setOptions()). It would be great to have a callback that would be called when the script is loaded, so one could set custom options more reliably. Or perhaps using some kind of trigger on the form itself (or document?). Also, if the form ID could be passed to this callback/trigger it would be nice, as one could apply different options to different forms when having more than one of them on one page.

Sorry if there's something like this already built-in that I've missed.

Could you propose some solution for better setting the options via PR? I'm not very experienced in JavaScript and lately I have also different priorities than working on this script. So help is welcomed :)

Ok, I used your solution for setting options before script is loaded, see 482c9ef.

I don't want to write code for custom options per form, but you can send PR.

Thanks, this will be perfect for a while!