Hi everyone....
pls a little support, before I bang my head against the wall all night.
what I need is hopefully pretty simple.
I need to fill an element value of a repeated group with the count of its subgroup (as two digit number).
For example: There are 2 Subgroups. Field to be filled is called SUBID. Now in Subgroup 1 , SUBID field should contain "01". In Subgroup 2, SUBID should contain "02" and so on....
Would need to do that with javascript.
I managed to do this with php in the form template with
<?php if ($group->canRepeat) {
$i=0;
foreach ($group->subgroups as $subgroup) {
$i=$i+1;
echo '<span>SUBGROUP '.$i.'</span>';
?>
to give the Subgroup titles the count, but I cant manage to do this to elements.
Thanks so much!!
pls a little support, before I bang my head against the wall all night.
what I need is hopefully pretty simple.
I need to fill an element value of a repeated group with the count of its subgroup (as two digit number).
For example: There are 2 Subgroups. Field to be filled is called SUBID. Now in Subgroup 1 , SUBID field should contain "01". In Subgroup 2, SUBID should contain "02" and so on....
Would need to do that with javascript.
I managed to do this with php in the form template with
<?php if ($group->canRepeat) {
$i=0;
foreach ($group->subgroups as $subgroup) {
$i=$i+1;
echo '<span>SUBGROUP '.$i.'</span>';
?>
to give the Subgroup titles the count, but I cant manage to do this to elements.
Thanks so much!!