Welcome, Guest
Username: Password: Remember me

TOPIC: Have caption for the Drop down field type.

Have caption for the Drop down field type. 2 years 8 months ago #63957

write now the drop field is like.


can we have it like:


Thanks
The administrator has disabled public write access.

Re: Have caption for the Drop down field type. 2 years 8 months ago #63979

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3818
  • Thank you received: 683
  • Karma: 328
I don't think there's an easy way to do it with CSS but you could use JavaScript to insert the Help text of the question before the dropdown element.

Note: This example is for the default template.

1) Set up your survey to use JavaScript.

2) Add the text you would like to the "Help" field of the question.

3) Add the following script to the source of the question. Replace "QQ" with the question ID.

The script moves the help text to before the dropdown element and then hides the help container.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		insertText(QQ);
 
		function insertText(qID) {
			var text = $('#question'+qID+' .survey-question-help').text();
			$('<span>'+text+'</span>').insertBefore('#question'+qID+' select');
			$('#question'+qID+' .survey-question-help').hide();
		}
 
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 2 years 8 months ago by tpartner.
The administrator has disabled public write access.

Re: Have caption for the Drop down field type. 2 years 8 months ago #63996

Thanks again - i think this might be helpful.

thanks
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.099 seconds
Donation Image