javascript validations implemented