Validator messages in alert or modal

How do I display validation rules message from a validator in an alert or modal

When its linked to the field it shows up under the field input in red