Sauter la navigation

[Résolu] Make field required.

This support ticket is created Il y a 5 années et 9 mois. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par AndreG3332 Il y a 5 années et 9 mois.

Assisté par: Nigel.

Auteur
Publications
#1209450

I want to make my first name and surname fields required fields in a user form. This is a default user with no additional fields. How do i do it?

#1209506

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

You would have two choices.

One is to add a little JS that added the required attribute to the fields in question, which would add native browser-based validation. (See lien caché.)

The other would be to add server-side validation using the cred_form_validate hook ( https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate).

(A final option for the long term would be to request that in Forms it would be possible to directly add attributes to form fields: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/)

#1222256

My issue is resolved now. Thank you!