javier94
Member
I have 3 columns in a repeteable group..
column 1 = are months numbers
column 2 = a dropdown with 3 items...
0 ---> " ---" --> value --> "0"
1 --> " no related" --> value "0"
2--> " related" --> value " number appears in column 1"
column 3 = value of column 1.. if you change the dropdown...
i show you the image..
if i save the form.. when i enter again.. the value is ok.. but the point is..
I need to see the value.. when i change the dropdown.. ( column 2) because there are some elements that
should make a calculation after the sum of repeteable..
the code use for calculation in column 3 is...
$var = '{merits_candidats_815_repeat___relacionada_public_1_raw}';
if ($var == "2"){
$res = '{merits_candidats_815_repeat___mesos_public_1}';
} else {
$res = "0";
}
return $res;
Ajax observe fields
'{merits_candidats_815_repeat___relacionada_public_1_0}'
---------
And the code to obtain sum value from repeteable ( i saw in other post)
$amounts = (array) $data['merits_candidats_815_repeat___value_public_1_raw'];
return '?' . array_sum($amounts);
ajax observe fields
{merits_candidats_815_repeat___value_public_1_0},
{merits_candidats_815_repeat___relacionada_public_1}
any suggestion... ??
Thanks
column 1 = are months numbers
column 2 = a dropdown with 3 items...
0 ---> " ---" --> value --> "0"
1 --> " no related" --> value "0"
2--> " related" --> value " number appears in column 1"
column 3 = value of column 1.. if you change the dropdown...
i show you the image..
if i save the form.. when i enter again.. the value is ok.. but the point is..
I need to see the value.. when i change the dropdown.. ( column 2) because there are some elements that
should make a calculation after the sum of repeteable..
the code use for calculation in column 3 is...
$var = '{merits_candidats_815_repeat___relacionada_public_1_raw}';
if ($var == "2"){
$res = '{merits_candidats_815_repeat___mesos_public_1}';
} else {
$res = "0";
}
return $res;
Ajax observe fields
'{merits_candidats_815_repeat___relacionada_public_1_0}'
---------
And the code to obtain sum value from repeteable ( i saw in other post)
$amounts = (array) $data['merits_candidats_815_repeat___value_public_1_raw'];
return '?' . array_sum($amounts);
ajax observe fields
{merits_candidats_815_repeat___value_public_1_0},
{merits_candidats_815_repeat___relacionada_public_1}
any suggestion... ??
Thanks