Added JS event handlers for register and login actions.