Javascript client/server form validation