Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Validating individual fields in an array

  • MalcolmHart
  • MalcolmHart's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 week ago #183087 by MalcolmHart
Validating individual fields in an array was created by MalcolmHart
LimeSurvey 2.65.

Hi

I have a question called CostsArray that consists of 7 subquestions, each with three answers, forming a 7 x 3 array or table.

The codes for each row of the array are (I presume) 1, 2, 3, 4, 5, 6, 7 and the subquestions (columns) are SQ001, SQ002...

I'm attempting, and failing, to ensure that if the user enters anything in the top left field of the table, they will be told that this field should not be completed. All the other fields may contain an integer.

As far as I understand it, the field in question is CostsArray_1_SQ001.NAOK

I have tried the following, adding the following to the 'Sub-question validation equation' field:

!is_empty(CostsArray_1_SQ001.NAOK)

and an error message to the 'Sub-question validation tip' field.

However, when testing it, I find that the error message (together with the 'Only numbers may be entered in these fields') is already visible on the page when it loads. When I enter numbers into the first (or indeed any field), both messages disappear and reappear with each keystroke and I have no idea why.

It strikes me that this should be a straightforward thing to do, but I am at a loss.


Is my expression correct?

Am I incorrect in thinking that I can validate each of the fields in my table individually?

Is it possible to validate only the first cell in the first row?

Why do the built-in error message ("Only numbers may be entered...") and my error message ('"Do not complete this field") both fire, regardless of the content of any of the fields?

Is it possible to display only the relevant message/tip?



Many thanks in advance

Malcolm
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 week ago #183093 by DenisChenu
Replied by DenisChenu on topic Validating individual fields in an array
What is the exact question type ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • MalcolmHart
  • MalcolmHart's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 week ago #183099 by MalcolmHart
Replied by MalcolmHart on topic Validating individual fields in an array
Thanks Denis. It's an array of numbers; none are mandatory. Is that what you meant?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 week ago #183111 by DenisChenu
Replied by DenisChenu on topic Validating individual fields in an array
Did you try CostsArray_SQ001_1.NAOK ?

And for testing : put this in question text

If you can send a sample lss file too.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 week ago #183112 by holch
Replied by holch on topic Validating individual fields in an array
Generally, in an array (of not array by column) the columns are answer options and the rows are the subquestions. Probalby your problem is there.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose