How to assign dropdown value to the field in Multiplier

tempus 15 Jul, 2015
Hi dear admins!

I have a multiplier in my form, that stores data in separate table. To link the main table and multiplier table I want to assign the dropdown value from the main part of the form to a field, that placed in the multiplier. It might be a hidden field I think.

Of course I've read the https://www.chronoengine.com/faqs/70-cfv5/5245-how-can-i-use-the-multiplier-in-cfv5.html and I saw your recommendation to get an 'id' from main form. It is clear, except how to assign this 'id' to some field in multiplier.

Can you please post here some "How to" or just explain what I have to do?

Thank you for good component!
GreyHead 15 Jul, 2015
Answer
1 Likes
Hi Tempus,

I would do it after the form submits - lets say that your multipler data is in $form->data['m_data'] and the drop-down value is in $form->data['dd']:
<?php
foreach ($form->data['m_data'] as $k => $v) {
  $form->data['m_data'][$k]['dd'] = $form->data['dd'];
}
?>

Bob
tempus 15 Jul, 2015
It works perfect!

Thank you for very useful advice, Bob.
This topic is locked and no more replies can be posted.