Hi Jana,
Please try below mentioned javascript code, apply it as a custom javascript code on the field you want to set required/not-required.
------------------------
var rows = count('/my:myFields/my:Repeating_Table_2/my:Repeating_Content/my:field_2');
var isRequired = false;
for(var i =0;i<rows;i++)
{
if ($form.getValue('/my:myFields/my:Repeating_Table_2/my:Repeating_Content['+i+']/my:field_2') !== '') {
isRequired= true;
break;
}
}
if(isRequired)
{
for(var i =0;i<rows;i++)
{
$form.setControlRequired('/my:myFields/my:Repeating_Table_2/my:Repeating_Content['+i+']/my:field_2', true);
}
}
else
{
for(var i =0;i<rows;i++)
{
$form.setControlRequired('/my:myFields/my:Repeating_Table_2/my:Repeating_Content['+i+']/my:field_2', false);
$form.removeErrorInfo('/my:myFields/my:Repeating_Table_2/my:Repeating_Content['+i+']/my:field_2')
}
}
------------------------------------------
Note : (/my:myFields/my:Repeating_Table_2/my:Repeating_Content/my:field_2) -- this xpath of the field/textArea that you want to set required/not-required.
-----------------
Hope this helps.
Regards
------------------------------
Hammad Naeem
Precisely Software Inc.
------------------------------