- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Numeric Response Validation for a comments box
- x_Dbeethekidd_x
- Topic Author
- Offline
- New Member
Less
More
4 years 7 months ago #188711
by x_Dbeethekidd_x
Numeric Response Validation for a comments box was created by x_Dbeethekidd_x
Hi All
I've tried to use the manual but it really doesn't make any sense to me in terms of what and where I need to enter the expressions/validations etc to achieve what I'm trying to do
I basically want to enforce a numeric response in the comments box from a multiple choice (unless there is a better question layout to use)
Thanks
DB
I've tried to use the manual but it really doesn't make any sense to me in terms of what and where I need to enter the expressions/validations etc to achieve what I'm trying to do
I basically want to enforce a numeric response in the comments box from a multiple choice (unless there is a better question layout to use)
Thanks
DB
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 7 months ago #188721
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Numeric Response Validation for a comments box
Hi, DB,
well, in my opinion there are other options:
Now the respondent selects an item and then has to enter a numeric value into the comment box?
In an multiple numerical input the respondent only enters the numerical values into the selected cells - others stay empty.
You get the same information: Which item was selected and which value was entered.
But in your case:
You know how this question type is stored in the answer table.
You see it there:
So the question validation equation could be:
The comment box is either empty or the entered value is numeric.
In
manual.limesurvey.org/Expression_Manager...mplemented_functions
you find exactly these two needed functions
We said "The comment box is either empty or the entered value is numeric."
Meaning:
is_empty(Q1_SQ001comment) OR is_numeric(Q1_SQ001comment)
This you validate for all subquestions:
(is_empty(Q1_SQ001comment) OR is_numeric(Q1_SQ001comment)) AND
(is_empty(Q1_SQ002comment) OR is_numeric(Q1_SQ002comment)) AND
...
(is_empty(Q1_SQ00Xcomment) OR is_numeric(Q1_SQ00Xcomment))
Joffm
well, in my opinion there are other options:
Now the respondent selects an item and then has to enter a numeric value into the comment box?
In an multiple numerical input the respondent only enters the numerical values into the selected cells - others stay empty.
You get the same information: Which item was selected and which value was entered.
But in your case:
You know how this question type is stored in the answer table.
You see it there:
So the question validation equation could be:
The comment box is either empty or the entered value is numeric.
In
manual.limesurvey.org/Expression_Manager...mplemented_functions
you find exactly these two needed functions
- is_empty: Determine whether a variable is considered to be empty
- is_numeric: Finds whether a variable is a number or a numeric string
We said "The comment box is either empty or the entered value is numeric."
Meaning:
is_empty(Q1_SQ001comment) OR is_numeric(Q1_SQ001comment)
This you validate for all subquestions:
(is_empty(Q1_SQ001comment) OR is_numeric(Q1_SQ001comment)) AND
(is_empty(Q1_SQ002comment) OR is_numeric(Q1_SQ002comment)) AND
...
(is_empty(Q1_SQ00Xcomment) OR is_numeric(Q1_SQ00Xcomment))
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 7 months ago #188731
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Numeric Response Validation for a comments box
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.