- Posts: 40
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Validate multiple short text and add additional info in date question type
- jajas
- Topic Author
- Offline
- Senior Member
Less
More
8 years 7 months ago #123332
by jajas
Validate multiple short text and add additional info in date question type was created by jajas
Dear LS Team,
I have two question type Multiple short text and Date question Type.
Q1. Please mention online shop that you ever buy something.
Note: plesase fill wiht "-" If you don't know the answer
A1.__________________
A2.__________________
A3.__________________
A4.__________________
Q2. When you last time to shop in online shop.[Date question with drop down]
DD MM YYYY
in Q2. I want to make a rule if all input box are filled with "-" the quest will display warning if question in not fill yet.
in Q2. If responden forget the date, the responden have choice "Im forget". So I need additional item, like Other option in radio button
question Type
I have two question type Multiple short text and Date question Type.
Q1. Please mention online shop that you ever buy something.
Note: plesase fill wiht "-" If you don't know the answer
A1.__________________
A2.__________________
A3.__________________
A4.__________________
Q2. When you last time to shop in online shop.[Date question with drop down]
DD MM YYYY
in Q2. I want to make a rule if all input box are filled with "-" the quest will display warning if question in not fill yet.
in Q2. If responden forget the date, the responden have choice "Im forget". So I need additional item, like Other option in radio button
question Type
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 7 months ago #123341
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 Validate multiple short text and add additional info in date question type
1) Assuming sub-question codes "SQ001", "SQ002", "SQ003", "SQ004", place something like this in the question text or help section:
2) Add a multiple-choice question with a single option - "I forget". Then you can use relevance to hide/show the date if the multi-choice is checked. CSS could be used to make the date and multi-choice appear as one.
Code:
{if(self.sq_SQ001 == '-' OR self.sq_SQ002 == '-' OR self.sq_SQ003 == '-' OR self.sq_SQ004 == '-', 'You have an unanswered item.', '')}
2) Add a multiple-choice question with a single option - "I forget". Then you can use relevance to hide/show the date if the multi-choice is checked. CSS could be used to make the date and multi-choice appear as one.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jajas
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 0
8 years 7 months ago #123373
by jajas
Replied by jajas on topic Validate multiple short text and add additional info in date question type
Hi tpartner, thanks for quick response.
The message is shown when sub question fill with "-" but it still can move to next page.
How to prevent it when all input box filled with "-"
The message is shown when sub question fill with "-" but it still can move to next page.
How to prevent it when all input box filled with "-"
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 7 months ago #123386
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 Validate multiple short text and add additional info in date question type
Oh, you just said "display warning if question in not fill yet", nothing about submitting.
Something like this in the Question Validation field:
Something like this in the Question Validation field:
Code:
self.sq_SQ001 != '-' AND self.sq_SQ002 != '-' AND self.sq_SQ003 != '-' AND self.sq_SQ004 != '-'
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jajas
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 0
8 years 7 months ago #123390
by jajas
Replied by jajas on topic Validate multiple short text and add additional info in date question type
Hi Tpartner,
I just tried it. i added this script to question validation field. when i typed "-" in sub question, the input box change to
red background. Then i tried to type "abc" the input box still in red background and cannot submitted.
for your info: in put this script in text box "Validation".
but when i expand then "Advanced Setting" I found input box with label "Sub-question validation equation".
which one i should put the script?
I just tried it. i added this script to question validation field. when i typed "-" in sub question, the input box change to
red background. Then i tried to type "abc" the input box still in red background and cannot submitted.
for your info: in put this script in text box "Validation".
but when i expand then "Advanced Setting" I found input box with label "Sub-question validation equation".
which one i should put the script?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 7 months ago #123424
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 Validate multiple short text and add additional info in date question type
Place it in the " Question validation equation" field.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.