Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Additional Checkbox below textfield

Additional Checkbox below textfield 3 years 4 months ago #61844

Hello,

I am trying to setup a survey where some questions consist of three radio buttons, an additional textfield for comments and a checkbox below this textfield. With the additional checkbox the participants can mark that the comment in the textbox is of high importance for them.

To demonstrate what I mean, a short (photoshoped) example.

question.jpg


So my question is: is there a possibility to add a checkbox like this? Beyond that, is there a way to change the "Please enter your comment here" to something else (varying from question to question).

Appreciate any help

Greetings
Last Edit: 3 years 4 months ago by Dolgsthrasir. Reason: typo
The administrator has disabled public write access.

Re: Additional Checkbox below textfield 3 years 4 months ago #61866

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4293
  • Thank you received: 810
  • Karma: 373
To get the checkbox you will need to use another question. Add a multiple choice question with no question text (or hide the question text with CSS) and only one sub-question.

To dynamically modify the label text:

1) Set up your survey to use JavaScript.

2) Add the following script to the source of the question. Replace "QQ" with the question ID.
<script type="text/javascript" charset="utf-8">
 
	$('#questionQQ p.comment label').text('Some new label text...');
 
</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.
The administrator has disabled public write access.

Re: Additional Checkbox below textfield 3 years 4 months ago #61869

It works, thank you very much!
The administrator has disabled public write access.

Aw: Additional Checkbox below textfield 2 years 4 months ago #82660

  • FLF
  • FLF's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Karma: 0
Hello,
I have the same problem like Dolgsthrasir. I want to change the text "Please enter your comment here"
So I used the javascript like described, but it doesn't work.
Is it possible that the the limesurvey version Version changed and that's the reason.

I use version 1.92+
The administrator has disabled public write access.

Re: Additional Checkbox below textfield 2 years 4 months ago #82665

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4293
  • Thank you received: 810
  • Karma: 373
No, that selector should still work.

Can you activate a sample survey with your code in it?
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: Additional Checkbox below textfield 2 years 4 months ago #82723

  • FLF
  • FLF's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Karma: 0
Thank you for your answer.
Now it works. For some reason in the HTML source code the javascript code was above the code for the question.
So I included the javasript code into the question-group endgroup.pstpl and now it works. I know that the code is now in every question-group, but I think that there should be no problem.
The administrator has disabled public write access.

Re: Additional Checkbox below textfield 2 years 4 months ago #82729

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4293
  • Thank you received: 810
  • Karma: 373
Oh, wait, I see the problem. The script is being fired before the page is loaded.

This should work in the question source:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		$('#questionQQ p.comment label').text('Some new label text...');
	});
 
</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.
The administrator has disabled public write access.

Re: Additional Checkbox below textfield 2 years 4 months ago #82739

  • FLF
  • FLF's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Karma: 0
:) thank you!!
The administrator has disabled public write access.

Re: Additional Checkbox below textfield 2 years 4 months ago #82853

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5348
  • Thank you received: 298
  • Karma: 250
FLF wrote:
:) thank you!!
You're welcome :-)

If our hints have been helpful and you enjoy limesurvey please consider a donation to give Limesurvey a future .
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.

Re: Additional Checkbox below textfield 1 year 5 months ago #96546

  • misterdot
  • misterdot's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 35
  • Thank you received: 1
  • Karma: 0
I'm having trouble getting this to work. I'm using Version 2.00+ Build 130305 and javascript is enabled (using it elsewhere). I've attached a screen shot of what I'd like it to be and a sample (not working) survey. Can't figure out what I'm doing wrong.
Thanks!
Matt
Attachments:
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.150 seconds
Donation Image