Can I reorder attribute fields in Registration Form?

More
3 years 2 months ago #111796 by shiyaoliu
shiyaoliu created the topic: Can I reorder attribute fields in Registration Form?
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!

Please Log in to join the conversation.

More
3 years 2 months ago #111814 by shiyaoliu
shiyaoliu replied the topic: Can I reorder attribute fields in Registration Form?
Find the solution myself. Simply reorder the code sections concerned in /application/helpers/replacement_helper.php

Please Log in to join the conversation.

More
3 years 2 months ago #111827 by tpartner
tpartner replied the topic: Can I reorder attribute fields in Registration Form?
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:

$(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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!