remove first name and last name fields from the registration form

More
1 year 1 month 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!
Attachments:

Please Log in to join the conversation.

More
1 year 1 month ago - 1 year 1 month 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
Attachments:
Last edit: 1 year 1 month ago by Joffm.

Please Log in to join the conversation.

More
1 year 1 month 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!!
Attachments:

Please Log in to join the conversation.

More
1 year 1 month 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

Please Log in to join the conversation.

More
1 year 1 month ago #208691 by xibit12
Thank you Joffm!! It worked!

Please Log in to join the conversation.

More
11 months 6 days ago #211854 by tassoman

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 »

Please Log in to join the conversation.

More
11 months 6 days 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
Attachments:
The following user(s) said Thank You: tassoman

Please Log in to join the conversation.

More
3 months 3 weeks ago - 3 months 2 weeks 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 months 2 weeks ago by Payek. Reason: add LS version/template

Please Log in to join the conversation.

More
3 months 2 weeks 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

Please Log in to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks 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 months 2 weeks ago by Payek.

Please Log in to join the conversation.

More
3 months 2 weeks ago #220285 by Joffm
Did you just change here
        <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
Attachments:

Please Log in to join the conversation.

More
3 months 2 weeks 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:

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

 

Please Log in to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #220296 by Joffm
Sorry, I do not see an issue. Tested in 5.1.10. and 3.27.17
Try to clear your caches (browser, assets)

Anyway you could try to hardcode. Instead of {{ gT("First name:") }} only Login:

BTW: I do not see a registration form in your survey.


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 months 2 weeks ago by Joffm.
The following user(s) said Thank You: Payek

Please Log in to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #220317 by Payek
Thank you Mr. Joffm very much! 
Your post pointed me on right path! Everything work perfectly!
I made mistake - I edited register_form.twig and expected changes in resume_later form...

For others greenhorns (like me) - "resume later" screen you can edit in save.twig.

THX!
Pawel
Last edit: 3 months 2 weeks ago by Payek.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now