- Posts: 11
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
5 months 4 days ago #252538
by adilar39
Reset array text when auto-filled and changed to read only was created 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.
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.
Attachments:
Please Log in to join the conversation.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
5 months 3 days ago - 5 months 3 days ago #252542
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Reset array text when auto-filled and changed to read only
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"
Joffm
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"
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 0
5 months 3 days ago #252601
by adilar39
Replied by adilar39 on topic Reset array text when auto-filled and changed to read only
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.
Thank you, Joffm.
Please Log in to join the conversation.