Hi Support
Is there any way we can prevent users programmatically from entering email addresses or phone numbers in certain multi-line text fields?
We see it as a source of abuse for our directory listing based site. For example, we would like to prevent nannies or families entering their phone numbers or email addresses thus avoiding the need to subscribe to make contact with each other...
I'm thinking along the lines of something like:
Email addresses:
a) preventing entry of the @ symbol
b) preventing entry of common domain endings like .com, .de, etc
Phone numbers:
c) preventing entry of phone numbers, eg preventing or detecting numbers larger than 10 within the text
d) preventing entry of the + symbol for international numbers
e) detecting/preventing entry of (xxx) or xxx-xxxxx-xxx or xxx/xxxxxxx or similar..
Ideally we would like to be able to prevent it altogether, eg by not allowing them to save a record if it contains one of the offending items and telling them why. Of course there are creative ways around this, but we would like to reduce abuse as much as possible.
Thanks and regards
Simon
Hello,
I assume we are talking about Toolset post form for creating new posts.
There isn't such kind of built-in feature within Toolset plugins, you might consider custom codes, for example, when user submit the post form, use filter hook "cred_form_validate" to trigger a custom PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
In this PHP function validate each form field, and output error messages.
Hi Luo
Please don't close this one yet, I'm working on it but I might need some assistance to get the cred_form_validate working - it's not working 100% correctly yet.
Kind regards
Simon
I have marked this thread as "Waiting for feedback" status, please update here if you still need assistance for it.