behavior_validatePhoneNumber_customfield

PHOTO EMBED

Wed Nov 13 2024 19:51:55 GMT+0000 (Coordinated Universal Time)

Saved by @belleJar #groovy

// Phone number validator (simple)


getFieldById(getFieldChanged()).getValue().toString().find("[^0-9]|.{11,}") ? getFieldById(getFieldChanged()).setError("This field only allows 10 characters and they must be numeric.") : getFieldById(getFieldChanged()).clearError();
content_copyCOPY

Validates field is numeric and string size smaller than 11