Welcome to the LimeSurvey Community Forum

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

It is possible to set the token attributes FIRSTNAME and LASTNAME to mandatory

More
7 years 4 months ago #144142 by Qsgt
Hi,

I have a survey that uses tokens and is open for public registration. My public registration form has email, first name and last name fields. However the only mandatory field is email address. Is it possible to set the first and last name fields as mandatory?
I know that I can set custom attributes as mandatory but the FIRSTNAME and LASTNAME attributes and not listed there because they are not custom attributes.

Any ideas as to how/ if I can do it.

Thanks,
qsgt
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #144149 by tpartner
You could hide the original first and last name fields and add you own mandatory attributes for those.

In LimeSurvey version 2.5x, adding this to the end of template.js will hide those fields.
Code:
$(document).ready(function() {
  if($('.register-form #register_firstname').length > 0) {
    $('.register-form #register_firstname').closest('.form-group').hide();
    $('.register-form #register_lastname').closest('.form-group').hide();
  }
});

Alternatively, you may be able to do something with Denis' "replaceRegister" plugin - framagit.org/SondagePro-LimeSurvey-plugin/replaceRegister

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Qsgt
The topic has been locked.
More
7 years 4 months ago #144166 by Qsgt
Thanks for the suggestions.

I will investigate,
qsgt
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose