Welcome, Guest
Username: Password: Remember me

TOPIC: Show totals zero default

Show totals zero default 2 years 6 months ago #66064

  • TAdams
  • TAdams's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
I have an array (text) question type with a show totals for rows column. The total textboxes include a zero as the default value. I need this textbox value to default to null. Hiding the zero is fine. Any ideas?

Thank you in advance.
The administrator has disabled public write access.

Re: Show totals zero default 2 years 6 months ago #66067

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
You can overwrite the displayed "0" value by using some Javascript to fill the text field with a different or a blank value.
Have a look at manual -> workarounds ->JavaScript. There are several examples on how to fill a text field. You just need to take care to assign the correct field ID.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Show totals zero default 2 years 6 months ago #66093

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
Add the following to the end of template.js. Note that this will affect all array questions showing totals. You could add a question ID to the selector to make it question-specific.
	$(document).ready(function() {
 
		$('.array-multi-flexi-text table.show-totals td.total input[type="text"], .array-multi-flexi-text table.show-totals tr.total input[type="text"]').each(function(i){ 
			if($(this).val() == 0) {
				$(this).val('');
			}
		});
	});
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.
The administrator has disabled public write access.

Re: Show totals zero default 2 years 6 months ago #66248

  • TAdams
  • TAdams's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Tony thank you so much. This works perfectly. You just made my life so much easier! :laugh:
The administrator has disabled public write access.

Re: Show totals zero default 2 years 6 months ago #66271

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.129 seconds
Donation Image