Array text question with "+""-" button: Not remove text after clicking on "-"

More
11 months 4 weeks 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
Attachments:

Please Log in to join the conversation.

LimeSurvey Partners
More
11 months 4 weeks ago - 11 months 4 weeks 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
Attachments:
Last edit: 11 months 4 weeks ago by Joffm.
The following user(s) said Thank You: carolsguerra

Please Log in to join the conversation.

More
11 months 4 weeks 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
Attachments:
The following user(s) said Thank You: carolsguerra

Please Log in to join the conversation.

More
11 months 4 weeks ago #187644 by SherriChen
Wow! Perfect! Thank you very much, Joffm!

Please Log in to join the conversation.

More
9 months 2 weeks ago #190486 by carolsguerra
WONDERFUL!
hello, could you send me the lss file of this question? I would be very grateful and happy. =)

Please Log in to join the conversation.

More
9 months 2 weeks ago #190493 by SherriChen
Hi, here is the file.

File Attachment:

File Name: limesurvey...1868.lss
File Size:36 KB
Attachments:

Please Log in to join the conversation.

More
1 week 6 days 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.

Please Log in to join the conversation.

More
1 week 6 days 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 week 5 days 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.

Please Log in to join the conversation.

More
1 week 5 days ago #203535 by SherriChen
Hello,

I have tested, "+" "-" button still works for me in LS 3.22.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now