frontend implementation of phone number validation