I have used dynamic form widget. The form fields are shown in the image below. As you can see there is a check box named cancel. What I want is if the cancel
check box is clicked, It will only requires the check number and will allow the rest to be empty. Without using dynamic form I can easily implement this using when
and whenClient
validators since I can get exactly the name
of the checkbox.
The problem here is that the dynamic form generates this kind of name
series for the checkboxes...
TblDvBub[0][is_cancelled][]
TblDvBub[1][is_cancelled][]
TblDvBub[2][is_cancelled][]
I think you could extract the name of is_cancelled checkbox using 'attribute.name' from 'whenClient' => 'function(attribute, value){}' argument. console.log that 'attribute' - there must be an object with 'name' property - there you may get the number (use regex) of current TblDvBub. By the way why do you use multiple is_cancelled[] field - doesn't it already belong to particular TblDvBub subarray?