Add validate js functions for registering.
Validate form before submit in register page.