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

Timing of setting custom options #23

Closed rolandtoth closed 8 years ago

rolandtoth commented 8 years ago

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.

Robyer commented 8 years ago

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 :)

Robyer commented 8 years ago

Ok, I used your solution for setting options before script is loaded, see https://github.com/Robyer/nette-live-form-validation/commit/482c9ef5bba7441b739655c7cdea5378efe44d3d.

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

rolandtoth commented 8 years ago

Thanks, this will be perfect for a while!