Welcome to the LimeSurvey Community Forum

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

Can I reorder attribute fields in Registration Form?

  • shiyaoliu
  • shiyaoliu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 6 months ago #111796 by shiyaoliu
Hi. I am installing LimeSurvey for an academic social survey, and am wondering whether I can reorder the attribute fields in the registration form?

When I open public registration for a certain survey, those who do not have tokens will need to fill out a registration form before continue with the questionnaire. The order of attributes in the registration form is "First Name" "Last Name" and then "Email". However, since Chinese people usually put "Last Name" first, I would like to reorder it into "Last Name" "First Name" and "Email".

I do not want to change the translation file since it may conflict with email templates (i.e. we still need to call people Mr "Last Name" in formal emails.)

Does anyone know how I can do that? Thank you very much!
The topic has been locked.
  • shiyaoliu
  • shiyaoliu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 6 months ago #111814 by shiyaoliu
Find the solution myself. Simply reorder the code sections concerned in /application/helpers/replacement_helper.php
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 6 months ago #111827 by tpartner
Rather than hacking the core code (which will be subject to overwriting on updating), I would use JavaScript to move the elements.

Add this to template.js:

Code:
$(document).ready(function(){ 
  if($('.register-form-table').length > 0) {
    $('tr.register-form-fname').before($('tr.register-form-lname'));
  }
});


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose