adding support for hooking in Javascript library for validating data before submit