Remove/Hide field from registration form

We would like to remove the question about gender from the user registration page. This information isn’t used by the journal and we don’t need to collect that information.

I thought that I could simply hide that field using CSS in the journal stylesheet. I tried adding this line to the journals custom CSS:

#register > .data > tbody:nth-child(1) > tr:nth-child(12) {
      display: none; }

This seems to work (it simply hides the question) but now I’ve started seeing problems with new user registration. New users get an error when trying to complete the Captcha style validation form.

So I’m wondering if there is a way to improve my CSS to hide that question or another way to solve this problem. Doing something on the front end (via CSS or the admin interface) would be preferable but I would consider making small changes to other files.

Since the CAPTCHA (or any other early form changes) will change the index of the tr which holds the gender, a by-name or by-id selection would be better. Unfortunately, CSS has no parent selector, so you are stuck with either using javascript to hide the element, or assigning a class or id to the tr by modifying the .tpl file.

Hello! I’m curious, how did you end up solving this?

I thought the gender field information was used by the journal to choose address (she/he) in the form letters, is this actually the case? (tagging @asmecher .

In any case, I saw a response on the old forum about how to delete fields in the registration form

https://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=12967&p=49816&hilit=gender#p49816

Does this advice still hold? We’d like to do the same.

I’m pretty sure the gender field is not used for pronoun customization. I don’t think it is actually used anywhere for functionality.

Yes, you can edit the forms and templates directly to remove the option, rather than just hiding it. In OJS 2.4.x, it looks like a complete removal would involve:

  • classes\manager\form\UserManagementForm.inc.php
  • classes\sectionEditor\form\CreateReviewerForm.inc.php
  • classes\subscription\form\SubscriptionForm.inc.php
  • classes\user\form\ProfileForm.inc.php
  • classes\user\form\RegistrationForm.inc.php
  • templates\manager\people\userProfile.tpl
  • templates\manager\people\userProfileForm.tpl
  • templates\sectionEditor\createReviewerForm.tpl
  • templates\sectionEditor\userProfile.tpl
  • templates\subscription\subscriptionFormUser.tpl
  • templates\subscription\userProfile.tpl
  • templates\user\profile.tpl
  • templates\user\register.tpl

Where is this tpl file? I’d like to try it that way!

See this post for an example of mapping a URL to the code with the Registration page: