Add additional validations for custom fields
I would like to add extra validations for custom fields being used for listings.
Basically, when a listing is being created or edited - I want additional validation to be run on some custom fields (checking that input is numbers/digits only).
As there is no way to limit custom fields to number type rather than text type (I spent a lot of time trying), I need to add validation to ensure that certain custom fields only contain numbers.
I've tried a whole bunch of approaches and nothing is working. I think the only way it could work in the theme is to add additional form validation.
If someone is able to provide code/instructions to achieve the above, it would be greatly appreciated!