i have a checkbox and a dropdown field in a repeater. the validation php code of the dropdown field depends on the checkbox value.
how can i access to the checkbos of the corresponding checkbox?
I don't now how to access the index of the reapter in the php code.
Hi juerg
You can enable the form debug and check the data array after you submit the form page, it will show the data structure, if both fields are inside the repeater then you will access them the same way using a PHP loop over the repeater array
But i need the row in the validation php not in the submit php. In row 2 i have to check if a valid data is set based on the value of an other field in the same row.
I get only the $value variable in the php code and not the row
if ($this->data[p][?] ==1 && value == 0) {
return " Error";
}
How can i get the value of ? the must be the same row as $value
i can't use triggers and listener as they are not specific to a container row .
Hi Juerg
You can not do it this way with a repeater, you need to use the Pre Submit action and add a PHP action inside where you can run your code and update the $this->errors array with the error message you need:

Hi Max
I was afraid of that. So the errors don't appers near the field, who cause the error. It appears on the top of page and it is not clear in wich of the reapter the error occurs.
But so..
Hi juerg
No problem, you can add the error to the field by setting the error under the field name:
$this->errors["first_name"] = "First name is incorrect";
Hi Max
that doesn't work with fields in a repeater. i use the fieldname first_name[1]
the errors are displayed at top of the form.
