- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Modify array question type?
- piquadrat
- Topic Author
- Offline
- New Member
Less
More
12 years 1 month ago #81023
by piquadrat
Modify array question type? was created by piquadrat
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10149
- Thank you received: 3607
12 years 1 month ago #81038
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Modify array question type?
Not out-of-the-box, but you can insert the text with JavaScript.
1) Set up your survey to use JavaScript .
2)Add the following script to the source of the array. Replace "QQ" with the array question ID .
The script adds a class to the cell for styling and inserts the text defined by newText.
3) Add something like the following to the end of template.css to style the inserted text.
1) Set up your survey to use JavaScript .
2)Add the following script to the source of the array. Replace "QQ" with the array question ID .
The script adds a class to the cell for styling and inserts the text defined by newText.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var qID = QQ; var newtext = 'Some inserted text...'; $('#question'+qID+' table.question thead td').text(newtext).addClass('insertedText'); }); </script>
3) Add something like the following to the end of template.css to style the inserted text.
Code:
td.insertedText { text-align: right; vertical-align: bottom; color: red; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: piquadrat
The topic has been locked.
- piquadrat
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
12 years 1 month ago #81042
by piquadrat
Replied by piquadrat on topic Aw: Modify array question type?
Thank you Tony!
Unfortunately your solution seem to exaggerate the job
The script replaces all cells with the same text (see picture below). Any idea how to avoid this?
And do you think it's possible to add html code in the "Some inserted text..." field as well?
Thanks again for your help! Much appreciated!
Unfortunately your solution seem to exaggerate the job
The script replaces all cells with the same text (see picture below). Any idea how to avoid this?
And do you think it's possible to add html code in the "Some inserted text..." field as well?
Thanks again for your help! Much appreciated!
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10149
- Thank you received: 3607
12 years 1 month ago #81044
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Aw: Modify array question type?
I tested with the default template. What template are you using and what question type?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- piquadrat
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
12 years 1 month ago #81051
by piquadrat
Replied by piquadrat on topic Aw: Modify array question type?
I use a slighty different template, however, I just doublechecked with the default template, which ends up with the same "error".
I'm using the array question type (translated as "Matrix" in German). However, I use custom answers. These are tables implemented by html code (see picture below).
I assume that there is a crossover conflict.
I'm using the array question type (translated as "Matrix" in German). However, I use custom answers. These are tables implemented by html code (see picture below).
I assume that there is a crossover conflict.
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10149
- Thank you received: 3607
12 years 1 month ago #81054
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Modify array question type?
Yes, that will cause a problem.
Try this:
Try this:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var qID = QQ; var newtext = 'Some inserted text...'; $('#question'+qID+' table.question thead > tr > td').text(newtext).addClass('insertedText'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: piquadrat
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10149
- Thank you received: 3607
12 years 1 month ago #81055
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Aw: Modify array question type?
Oh, yeah, and for inserting HTML:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var qID = QQ; var newhtml = '<table><tr><td>Some inserted HTML...</td></tr></table>'; $('#question'+qID+' table.question thead > tr > td').html(newhtml).addClass('insertedText'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: piquadrat
The topic has been locked.
- piquadrat
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
12 years 1 month ago #81078
by piquadrat
Replied by piquadrat on topic Aw: Re: Aw: Modify array question type?
Tony! Thank you so much!
Your solution just works wonderful now!
Your help is much appreciated!
Your solution just works wonderful now!
Your help is much appreciated!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10149
- Thank you received: 3607
6 years 8 months ago #159705
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Aw: Re: Aw: Modify array question type?
This is a 5-year-old thread and you haven't explained what the problem is. Please be more specific or open a new topic.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13233
- Thank you received: 4064
6 years 8 months ago #159706
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Aw: Re: Aw: Modify array question type?
Tony, do not answer him/her.
emilyjohn always writes something into old old threads.
Mostly just copies some text from former posts.
Same here. The text is from a former piquadrat post.
Sometimes I think it is alcohol or other drugs influenced. (sorry)
Joffm
emilyjohn always writes something into old old threads.
Mostly just copies some text from former posts.
Same here. The text is from a former piquadrat post.
Sometimes I think it is alcohol or other drugs influenced. (sorry)
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner
The topic has been locked.
- c_schmitz
- Offline
- LimeSurvey GmbH Employee
Less
More
- Posts: 330
- Thank you received: 92
6 years 8 months ago - 6 years 8 months ago #159870
by c_schmitz
Best regards
Carsten Schmitz
LimeSurvey project leader
Replied by c_schmitz on topic Aw: Re: Aw: Modify array question type?
The person is banned now and all her messages are removed - all of them were generic.
I'd guess it is a spam bot gone wrong.
I'd guess it is a spam bot gone wrong.
Best regards
Carsten Schmitz
LimeSurvey project leader
Last edit: 6 years 8 months ago by c_schmitz.
The topic has been locked.