Forums

Chained Dropdown Inside Multiplier

Yudhizth 14 Sep, 2015
Dear all,

How to user chained dropdown on mutliplier?. We know that multiplier has unique field name, for example : fileupload[__N__][provinsi]. When I tried to implement chained dropdown (province and district) with district db read condition :
 <?php
  return array( 'id_prov' => $form->fileupload[__N__][provinsi]);
  ?> 

and custom code
<?php
$options = array();
if ( !$form->data['Kabupaten'] || count($form->data['Kabupaten']) < 1 ) {
  // no result was found
  $options[] = '-Pilih Kabupaten-';
} else {
  foreach ( $form->data['Kabupaten'] as $d ) {
    $options[$d['id_kabupaten']] =  $d['nm_kab'];
  }
}
echo json_encode($options);
?>


Maybe I miss something?
Thanks
GreyHead 14 Sep, 2015
Hi Yudhizth,

You might be able to get this to work with some careful custom coding but I don't think that I would even try unless I had a very clear head.

Is the list of districts isn't too long it might work to hard code that in the drop-down events tab.

Bob
Yudhizth 14 Sep, 2015
Thanks Bob

Unfortunately, districts has more than 600 list😟 .
Yudhizth 17 Sep, 2015
Someone could help me? 😢
GreyHead 17 Sep, 2015
Hi Yudhizth,

Please see my previous post - this will need careful custom coding to get it to work - if that is possible,

Bob
This topic is locked and no more replies can be posted.