Convalidation with EM

5 years 5 months ago - 5 years 5 months ago #102703 by darpao
Convalidation with EM was created by darpao
Who can help me with this situation.

I crete an example, but what I should do is similar. See atteched file.

Q1 -> ask in a multiple choice with comments what are the components of a family. No matter if the user put one person and choice slot 4 (Person 4) instead of the first available. Only for person I ask name. So I hided the box for animals with javascript (1° request: is there a way to hide comments with EM or something else?)

if a people choice a Person, he MUST fill the comment (2° request: how I can force people to put comments?JavaScript?)

Q2 -> I show only the previous components choosen, showing the name if it was written in the comment (this is the only thing I was succesfull by myself). For each one (3° request: how can I validate if for every row of visible components a role was choosen.. so at least one check for every visible row) the user must choose a role.
Some roles are mandatory: every family must have an head of household, but it should be possible that nobody works and bring money (4° request: how can I make mandatory some columns? So a column can have 0 chcked answer, others must have at least 1 answer. All can have more than 1 answer)

(5° request: how can I disable some checkbox?) For example animals cannot work and bring money, so I would like to disable the corrisponding checkbox so that the user cannot click on it.

All these request require javascript? Or can I use validation with EM?

Where I can study some syntax about Javascript specific for Limesurvey? I read scripts and I find:
#question' + qID + ' table.question tbody tr';
$( arrayRow + ':eq(' + i + ')' ).length

and so on..
but I was not able to find a manual.

Thank you
Last edit: 5 years 5 months ago by darpao. Reason: added a question

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

LimeSurvey Partners

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!