Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

remove first name and last name fields from the registration form

  • xibit12
  • xibit12's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 2 months ago #208675 by xibit12
I would like to remove the fields first name and surname from the registration form and formulate the text/instruction myself. Unfortunately, I have only found outdated entries for this issue, and the codes unfortunately do not work. I use the fruity template and version 3.23.1 200825. I am very happy about hints!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 2 months ago - 4 years 2 months ago #208676 by Joffm
Hi,
to remove these fields
edit the "register_form.twig" in your extended theme

But consider these fields are mandatory, so you may enter something like "N.N".
Without these entries emails are not sent.

And to change the text usually you had to adapt the translation file.
forums.limesurvey.org/forum/german-forum...registrierung#207095

But if you are sure that it's only German you may hardcode the text.
edit the "register_message.twig"

Instead of the gT-function that translates the system text into the text of the survey you may enter your desired text.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 2 months ago by Joffm.
The topic has been locked.
  • xibit12
  • xibit12's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 2 months ago #208677 by xibit12
Thank you for your answer!!
I deleted the parts " {# Participants first name #}" and "{# Participants last name #}" from the script and it worked.
I also modified the text in "register_message.twig".
Now, when I'm registered, I receive that following table attached.
Is there a way to delete the first two rows?
Thanks a lot!!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 2 months ago #208680 by Joffm
Hi,
so you edited these files in the theme editor.
Why didn't you have a look at the other related "*.twig" files?
There is one with an eye catching name "register_success.twig" ;)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: xibit12
The topic has been locked.
  • xibit12
  • xibit12's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 2 months ago #208691 by xibit12
Thank you Joffm!! It worked!
The topic has been locked.
More
4 years 1 day ago #211854 by tassoman

Joffm wrote: But consider these fields are mandatory, so you may enter something like "N.N".
Without these entries emails are not sent.


I'm running LS 3.24.6.
I also thought First, Last name were mandatory fields but they aren't. You can still register to the survey without any first-last name. Just email address.
Is there the opposite functionality, making them mandatory, instead of removing fields?
 

«All your survey answers are belong to us »
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 day ago #211861 by Joffm
Yes, you are right.
I was confused by this phrase in the manual

The first line must contain the field names. It must also contain the following fields: firstname, lastname, email.

The first line must contain these fields, but firstname and lastname may be empty.

But answering your question:
In the "register_form.twig" you find these lines
Lastname:
        {# Participants last name #}
        <div class='{{ aSurveyInfo.class.registerformcolrowb }} form-group row' {{ aSurveyInfo.attr.registerformcolrowb }}>
            <label {{ aSurveyInfo.attr.registerformcolrowblabel }}  class='{{ aSurveyInfo.class.registerformcolrowblabel }} control-label '>{{ gT("Last name:") }}</label>
            <div {{ aSurveyInfo.attr.registerformcolrowcdiv }}  
            <div {{ aSurveyInfo.attr.registerformcolrowbdiv }} >
                {{ C.Html.textField('register_lastname', aSurveyInfo.sLastName, ({'id' : 'register_lastname', 'class' : 'form-control'})) }}
            </div>
        </div>


Email:
        {# Participants email #}
        <div class='{{ aSurveyInfo.class.registerformcolrowc }} form-group row' {{ aSurveyInfo.attr.registerformcolrowc }}>
            <label {{ aSurveyInfo.attr.registerformcolrowclabel }} class='{{ aSurveyInfo.class.registerformcolrowclabel }}  control-label'> {{ gT("Email address:") }}
{{ include('./subviews/registration/required.twig') }}</label>
            <div {{ aSurveyInfo.attr.registerformcolrowcdiv }}  >
                {{ C.Html.textField('register_email', aSurveyInfo.sEmail, ({'id' : 'register_email','class' : 'form-control input-sm',
'required' : true})) }}
            </div>
        </div>


You see the two things to add.

 

Joffm





 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tassoman
The topic has been locked.
More
3 years 4 months ago - 3 years 4 months ago #220257 by Payek
Hi Mr. Joffm,
you wrote

But if you are sure that it's only German you may hardcode the text

Following this hint I'am able to change  "register_message.twig", but cannot change "First name" for "Login" in "register_form.twig". I will be grateful for a hint on how to do it.

LS Version 4.5.0+210412 and template Vanilla

Paweł
Last edit: 3 years 4 months ago by Payek. Reason: add LS version/template
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #220265 by Joffm

but cannot change "First name" for "Login" in "register_form.twig". I will be grateful for a hint on how to do it.
 

What to do?
What do you want to change? 

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 4 months ago - 3 years 4 months ago #220269 by Payek
Hi,
I want to change label of the first field in Register form (change label only) - from "First name" to "Login" to avoid any "associations" with personal data.

THX!
Pawel
Last edit: 3 years 4 months ago by Payek.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #220285 by Joffm
Did you just change here
Code:
        <div class='{{ aSurveyInfo.class.registerformcolrow }} form-group row' {{ aSurveyInfo.attr.registerformcolrow }}>
            <label for='register_firstname' class='{{ aSurveyInfo.class.registerformcolrowlabel }} control-label '>{{ gT("First name:") }}</label>
            <div class="">
                {{ C.Html.textField('register_firstname', aSurveyInfo.sFirstName, ({'id' : 'register_firstname','class' : 'form-control'})) }}
            </div>
        </div>

{{ gT("First name:") }}  to  {{ gT("Login:") }}


 

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 4 months ago #220292 by Payek
Thank you Joffm!
This change in register_form.twig  ( {{ gT("First name:") }}  to  {{ gT("Login:") }} ) was my first try, but...
I can see change in theme previrw (in Theme editor ->edit ) but nothing change in survey based on changed theme. I try activate / deactivate survey , reload theme but with no luck. What I'm doing wrong?

There is my test survey with change in theme:

[url]https://​​​​​​​https://socjoskop.pl/eSurvey/index.php/479959?lang=en[/url]

 
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose