Numeric Response Validation for a comments box

More
1 week 5 days ago #188711 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

Please Log in or Create an account to join the conversation.

More
1 week 5 days ago #188721 by Joffm
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
https://manual.limesurvey.org/Expression_Manager_-_presentation#Implemented_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
Attachments:

Please Log in or Create an account to join the conversation.

More
1 week 4 days ago #188731 by Joffm
By the way, here are a few other ways to ask this questions:

built-in




with javascript




Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!