Skip Navigation

[Resolved] Creating an unique custom field

This support ticket is created 4 years, 3 months 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.

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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 4 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1830623

Dear Sir/Madam,

Can I create a custom field and assign it as a unique field? For example, I want to add the mobile number field to user profile, I don't want more than one user can input the same number, or I create custom post "bank", there is no duplicated bank number allowed.

Can I do that? If not, any alternative solution? Will Toolset consider it?

best regards,

Kelvin.

#1832855

Hi Kelvin,

Thank you for contacting us and I'd be happy to assist.

If your website's users are using the Toolset's front-end forms to add data into these fields, then you can use the "cred_form_validate" hook for this check for duplicate entries:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

You'll find an example snippet for a similar requirement in this reply:
https://toolset.com/forums/topic/need-to-validate-unique-values-in-post-field/#post-1201756

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar