- Posts: 44
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Array text question with "+""-" button: Not remove text after clicking on "-"
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
4 years 7 months ago #187633
by SherriChen
Array text question with "+""-" button: Not remove text after clicking on "-" was created by SherriChen
Hi,
I have an array text question. I add "+" "-" button to this question under the guidance of the link manual.limesurvey.org/Workarounds:_Manip...ble_Text.29_question .
I make the first column read-only and insert some texts into this column.
I use "+" to add a new row, it looks like this:
A problem occurs after I click on "-" and then "+". The prefilled text in the cell SQ002_SQ001 has disappeared.
I want the prefilled text always to be shown no matter how many times the respondents click on "+" "-" button.
I think this issue can be solved by revising scripts, but I am not good at it. Can anyone help me? Thank you!
I attached a sample question.
I have an array text question. I add "+" "-" button to this question under the guidance of the link manual.limesurvey.org/Workarounds:_Manip...ble_Text.29_question .
I make the first column read-only and insert some texts into this column.
I use "+" to add a new row, it looks like this:
A problem occurs after I click on "-" and then "+". The prefilled text in the cell SQ002_SQ001 has disappeared.
I want the prefilled text always to be shown no matter how many times the respondents click on "+" "-" button.
I think this issue can be solved by revising scripts, but I am not good at it. Can anyone help me? Thank you!
I attached a sample question.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12791
- Thank you received: 3941
4 years 7 months ago - 4 years 7 months ago #187636
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Array text question with "+""-" button: Not remove text after clicking on "-"
Hi, Sherry,
unfortunately your provided survey is not complete.
It does not contain the script to add and remove the rows.
Nor does it contain the script for the dropdown column which your screenshot shows.
Some more questions:
The text of the prefilled cells is taken from a former question?
In your example the text is hardcoded in the script.
And there are no rows without this prefilled cell? In your provided example there are no.
As far as I remember your survey the stages were defined before.
So, why not insert these text into the subquestion text? Either as by EM {Q0_SQ001} or directly (layout with some css)
And if this question depends on a former question you know the number of rows that has to be displayed.
So you may show the necessary rows by relevance equation.
Joffm
addition:
If you are going to define the stages here (time of living there, address, etc.)
There was something about transfering the answer of the first row to the second, and so on.
Like this?
subquestion text:
<span style="font-size:10pt;color:silver">Stage 2</span><br><span style="font-size:12pt;color:maroon">{A1_SQ001_SQ002}</span>
unfortunately your provided survey is not complete.
It does not contain the script to add and remove the rows.
Nor does it contain the script for the dropdown column which your screenshot shows.
Some more questions:
The text of the prefilled cells is taken from a former question?
In your example the text is hardcoded in the script.
And there are no rows without this prefilled cell? In your provided example there are no.
As far as I remember your survey the stages were defined before.
So, why not insert these text into the subquestion text? Either as by EM {Q0_SQ001} or directly (layout with some css)
And if this question depends on a former question you know the number of rows that has to be displayed.
So you may show the necessary rows by relevance equation.
Joffm
addition:
If you are going to define the stages here (time of living there, address, etc.)
There was something about transfering the answer of the first row to the second, and so on.
Like this?
subquestion text:
<span style="font-size:10pt;color:silver">Stage 2</span><br><span style="font-size:12pt;color:maroon">{A1_SQ001_SQ002}</span>
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 7 months ago by Joffm.
The following user(s) said Thank You: carolsguerra
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12791
- Thank you received: 3941
4 years 7 months ago #187640
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Array text question with "+""-" button: Not remove text after clicking on "-"
Hi,
and here is some improvement of this question
Instead of the hardcoded text in the first column I piped the answer of the "till date" question into the subquestion text.
Best regards
Joffm
and here is some improvement of this question
Instead of the hardcoded text in the first column I piped the answer of the "till date" question into the subquestion text.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: carolsguerra
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 7 months ago #187644
by SherriChen
Replied by SherriChen on topic Array text question with "+""-" button: Not remove text after clicking on "-"
Wow! Perfect! Thank you very much, Joffm!
The topic has been locked.
- carolsguerra
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
4 years 4 months ago #190486
by carolsguerra
Replied by carolsguerra on topic Array text question with "+""-" button: Not remove text after clicking on "-"
WONDERFUL!
hello, could you send me the lss file of this question? I would be very grateful and happy.
hello, could you send me the lss file of this question? I would be very grateful and happy.
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
4 years 4 months ago #190493
by SherriChen
Replied by SherriChen on topic Array text question with "+""-" button: Not remove text after clicking on "-"
Hi, here is the file.
The topic has been locked.
- krosser
- Offline
- Elite Member
Less
More
- Posts: 222
- Thank you received: 10
3 years 7 months ago #203471
by krosser
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Replied by krosser on topic Array text question with "+""-" button: Not remove text after clicking on "-"
I wonder if you are able to still use the code for adding + and - buttons in the latest 3.22 version? Adding the code to custom.js doesn't add those elements to the question...
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
3 years 7 months ago #203475
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 Array text question with "+""-" button: Not remove text after clicking on "-"
There is a copy of the script for 3.x here -
manual.limesurvey.org/Workarounds:_Manip...ble_Text.29_question
(I submitted the original workaround but not the 3.x version so have not tested)
(I submitted the original workaround but not the 3.x version so have not tested)
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- krosser
- Offline
- Elite Member
Less
More
- Posts: 222
- Thank you received: 10
3 years 7 months ago #203533
by krosser
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Replied by krosser on topic Array text question with "+""-" button: Not remove text after clicking on "-"
Yes, I have used the second version, but it doesn't seem to work in the latest LS version...
Looks like the original poster used also version 3.x, based on the screenshots.
Looks like the original poster used also version 3.x, based on the screenshots.
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
- SherriChen
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 0
3 years 7 months ago #203535
by SherriChen
Replied by SherriChen on topic Array text question with "+""-" button: Not remove text after clicking on "-"
Hello,
I have tested, "+" "-" button still works for me in LS 3.22.
I have tested, "+" "-" button still works for me in LS 3.22.
The topic has been locked.