I have been asked to add string baed verification to a form, which is pretty new to me so i am just looking for some advice.
The validation would be +20.00 to -20.00, the + or - would be optional.
I have the “regex” part for this.
I also have other fields to create using similar validations that use the +/- and some that dont, so i am guessing I can just use the same for them as well?
If you have the regex, you can use the gform_field_validation filter. Example 6 is a good example showing a regex use with the filter. What have you tried so far?
I dont know what to change for:
1st line: Does validate_phone change? and the 10, 4? or do you just put validate_text ?
2nd line: Function, does this stay the same, apart from matching the “validate” part?
3rd line: I put my regex in there
4th line: Is this even needed? I guess it does but i dont know what needs to go in there.
5th line: Stays the same?
6th line: Message, i just put in what i want there.