Skip Navigation

[Closed] Prevent users entering email addresses or phone numbers in multi line text field

This support ticket is created 2 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 2 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#2312397

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

#2312795

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.

#2317059

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

#2317943

I have marked this thread as "Waiting for feedback" status, please update here if you still need assistance for it.

The topic ‘[Closed] Prevent users entering email addresses or phone numbers in multi line text field’ is closed to new replies.