added javascript for register form