Forums

Can I prepopulate a multiplier field?

fribse 19 May, 2016
I have a multiplier field and of course a multiplier-contents where I have a few fields defined.
FieldID: deltager[###][navn]


The multiplier has been set to show 1 repeat from the beginning, and I would like to prepopulate the 'navn' (name) field of that.
I've tried putting this code:
$form->data['deltager'['1']['navn']] = $user->get( 'name' ) ;

But it doesn't fill in in the first repeat?
Question is, does the repeat exist at all before I do a render html?
GreyHead 19 May, 2016
Answer
1 Likes
Hi fribse,

Please try
$form->data['deltager']['1']['navn'] = $user->get( 'name' ) ;

Bob
fribse 20 May, 2016
Ahaa, brackets placed wrong :-) That made it work, thankyou very much!
This topic is locked and no more replies can be posted.