Skip Navigation

[Resolved] Make some fields in the user registration mandatory

This support ticket is created 3 years, 9 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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 9 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#1198313
first name mandatory.png

Hi, I wanted to know how do I make some fields in the user registration mandatory in the frontend?

For example I want to make the first name mandatory. How you do it?

Then I wanted to know if I can make sure that when a registered user, goes to the page to post a new post, he does not have to re-enter his name, but will already be inserted according to what he entered when he registered. (with conditional logic ... but how)

Possible?

#1198385

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Since the "first name" user field is not a mandatory field by default, so there isn't such a built-in feature within Toolset form too.

As a workaround, you can try to setup some custom JS codes to add "required" attribute to those user fields, for example, edit your user form for creating user, click "JS Editor", add below JS codes:

jQuery(document).ready(function($) {
  $('input[name="first_name"]').attr('required', 'required');
})

More help:
hidden link
HTML <input> required Attribute