Custom attribute field validation and error throw

So in keycloak 20.0.5 i have create custom field like phone number and i want validate that either user entering the phone number or not it will throw or show an error message in page