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
  • SherriChen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 7 months ago #187633 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.

File Attachment:

File Name: limesurvey...6513.lss
File Size:21 KB
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago - 4 years 7 months ago #187636 by Joffm
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>

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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #187640 by Joffm
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

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
  • SherriChen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 7 months ago #187644 by SherriChen
Wow! Perfect! Thank you very much, Joffm!
The topic has been locked.
More
4 years 4 months ago #190486 by carolsguerra
WONDERFUL!
hello, could you send me the lss file of this question? I would be very grateful and happy. =)
The topic has been locked.
  • SherriChen
  • SherriChen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 4 months ago #190493 by SherriChen
Hi, here is the file.

File Attachment:

File Name: limesurvey...1868.lss
File Size:36 KB
The topic has been locked.
More
3 years 7 months ago #203471 by krosser
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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago #203475 by tpartner
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)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
3 years 7 months ago #203533 by krosser
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.

I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
  • SherriChen
  • SherriChen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 7 months ago #203535 by SherriChen
Hello,

I have tested, "+" "-" button still works for me in LS 3.22.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose