Hello!
I cant seem to get validation on column level with expressions to work. My goal is to verify that two different values from two different columns in matrix drop downs are the same. Ive tried on question level and that works but not on column level. Why is that? I paste my json code where ive tested this. The first two questions is on question level and the next two is on column level:
{
locale: "sv",
pages: [
{
name: "page1",
elements: [
{
type: "matrixdropdown",
name: "Q1",
validators: [
{
type: "expression",
text: "Q1 and Q2 has to be of the same value!",
expression: "{Q1.Row 1.Column 1} = {Q2.Row 1.Column 1}"
}
],
columns: [
{
name: "Column 1",
cellType: "text",
inputType: "number"
}
],
choices: [
1,
2,
3,
4,
5
],
cellType: "text",
rows: [
"Row 1"
]
},
{
type: "matrixdropdown",
name: "Q2",
validators: [
{
type: "expression",
text: "Q1 and Q2 has to be of the same value!",
expression: "{Q1.Row 1.Column 1} = {Q2.Row 1.Column 1}"
}
],
columns: [
{
name: "Column 1",
cellType: "text",
inputType: "number"
}
],
choices: [
1,
2,
3,
4,
5
],
rows: [
"Row 1"
]
},
{
type: "matrixdropdown",
name: "Q1ValidatorOnColumnLevel",
columns: [
{
name: "Column 1",
cellType: "text",
validators: [
{
type: "expression",
text: "Q1ValidatorOnColumnLevel.Row 1.Column 1 has to be of the same value as Q2ValidatorOnColumnLevel.Row 1.Column 1!",
expression: "{Q1ValidatorOnColumnLevel.Row 1.Column 1} = {Q2ValidatorOnColumnLevel.Row 1.Column 1}"
}
],
inputType: "number"
},
{
name: "Column 2",
cellType: "text",
validators: [
{
type: "expression",
text: "Q1ValidatorOnColumnLevel.Row 1.Column 2 has to be of the same value as Q2ValidatorOnColumnLevel.Row 1.Column 2!",
expression: "{Q1ValidatorOnColumnLevel.Row 1.Column 2} = {Q2ValidatorOnColumnLevel.Row 1.Column 2}"
}
],
inputType: "number"
}
],
choices: [
1,
2,
3,
4,
5
],
cellType: "text",
rows: [
"Row 1"
]
},
{
type: "matrixdropdown",
name: "Q2ValidatorOnColumnLevel",
columns: [
{
name: "Column 1",
cellType: "text",
validators: [
{
type: "expression",
text: "Q1ValidatorOnColumnLevel.Row 1.Column 1 has to be of the same value as Q2ValidatorOnColumnLevel.Row 1.Column 1!",
expression: "{Q1ValidatorOnColumnLevel.Row 1.Column 1} = {Q2ValidatorOnColumnLevel.Row 1.Column 1}"
}
],
inputType: "number"
},
{
name: "Column 2",
cellType: "text",
validators: [
{
type: "expression",
text: "Q1ValidatorOnColumnLevel.Row 1.Column 2 has to be of the same value as Q2ValidatorOnColumnLevel.Row 1.Column 2!",
expression: "{Q1ValidatorOnColumnLevel.Row 1.Column 2} = {Q2ValidatorOnColumnLevel.Row 1.Column 2}"
}
],
inputType: "number"
}
],
choices: [
1,
2,
3,
4,
5
],
cellType: "text",
rows: [
"Row 1"
]
}
]
}
]
}