behavior_limitMaxLengthNumeric_cf_validator

PHOTO EMBED

Wed Nov 13 2024 19:47:43 GMT+0000 (Coordinated Universal Time)

Saved by @belleJar #groovy

//Max value 10 characters 


getFieldById(getFieldChanged()).getValue().toString().find("[^0-9,\\.]|[0-9]{11,}|[0-9,\\.]{12,}|.*\\.[0-9]{3,}") ? getFieldById(getFieldChanged()).setError('Only numeric characters allowed, maximum to 10 including 2 decimal places') : getFieldById(getFieldChanged()).clearError();
content_copyCOPY

Validate max length, numeric and including decimal (10 numeric including 2 decimals)