Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Reset array text when auto-filled and changed to read only

  • adilar39
  • adilar39's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 months 4 days ago #252538 by adilar39
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.19+230509
Own server or LimeSurvey hosting: Own
Survey theme/template: fruity extended
==================
Hi everyone, I would like to ask some question.
I've already made a array (text) question with some Javascript. The 1st column will decide if the rest of the columns can be filled or not. When "exist" is chosen in the 1st column, user can proceed to fill the rest of the columns. But if they chose "none", the rest of the columns will automatically filled with 0 and change to read-only.
It works fine, but when user want to change from "none" to "exist", the rest of the columns still in read-only condition and the 0 value still inside.
How should I do to make that when they change answer, the rest of the columns back to where they can fill the answers?


I've tried adding "Reset Row" button like shown from this discussion  forums.limesurvey.org/forum/can-i-do-thi...elect-click-in-array but it's not working. I knew it's not working because it's an array question, not array (texts). But I tried to change it a little, and still can't make it works.

Survey is attached. Thanks in advance.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 months 3 days ago - 5 months 3 days ago #252542 by Joffm
Hi,
yes you missed a bit, only one line - the "trigger"

Here
I said "Exist" and entered some values
 
Now I changed my mind and selected "None"
 
Again I changed my mind 
 

Of course you can adapt a bit to empty the cells instead of leaving the "0"
 

File Attachment:

File Name: limesurvey...5415.lss
File Size:35 KB


Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 months 3 days ago by Joffm.
The following user(s) said Thank You: adilar39

Please Log in to join the conversation.

  • adilar39
  • adilar39's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 months 3 days ago #252601 by adilar39
Because this question will be mandatory, I need to put 0 when they chose "none" and back to empty when they change their answer to "exist". I've edit a bit of your code and it's work now.

Thank you, Joffm.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose