Login validation and change function in jquery