Hi
I am having a problem with displaying data in dropdowns. When i add more than one dropdown they seem to stop each other working. I am labelling each of them differently and have provided the code below. In this particular example the first dropdown should display dynamic data, in the second dropdown it should display a list of options. Initially the first dropdown worked however the second would not. Now i have managed to get the second to display data but the first dropdown will not display data even though i did not change anything. This has happened on all the forms that I have tried to show two dropdowns.
Has anyone come across this before? I am very new to chronoform and do not have a great understanding of the code. I also wondered if it could be another module in joomla causing it not to work?
I am having a problem with displaying data in dropdowns. When i add more than one dropdown they seem to stop each other working. I am labelling each of them differently and have provided the code below. In this particular example the first dropdown should display dynamic data, in the second dropdown it should display a list of options. Initially the first dropdown worked however the second would not. Now i have managed to get the second to display data but the first dropdown will not display data even though i did not change anything. This has happened on all the forms that I have tried to show two dropdowns.
Has anyone come across this before? I am very new to chronoform and do not have a great understanding of the code. I also wondered if it could be another module in joomla causing it not to work?
<?php
$keys = \GCore\Libs\Arr::getVal(\GCore\Libs\Arr::getVal($form->data, explode(".", "project")), explode(".", "[n].projectid"));
$values = \GCore\Libs\Arr::getVal(\GCore\Libs\Arr::getVal($form->data, explode(".", "project")), explode(".", "[n].projectname"));
$options = array_combine($keys, $values);
$field = array (
'name' => 'project',
'id' => 'project',
'options' =>
array (
'value' => 'projectname',
),
'empty' => '',
'values' =>
array (
),
'label' =>
array (
'text' => 'Project',
'position' => 'left',
),
'sublabel' => '',
'multiple' => '0',
'size' => '',
'class' => ' validate[\'required\']',
'title' => '',
'style' => '',
'params' => '',
':data-load-state' => '',
':data-tooltip' => '',
'type' => 'dropdown',
'container_id' => '0',
);
$field["options"] = $options;
echo \GCore\Helpers\Html::formLine($field["name"], $field);
?><div class="form-group gcore-form-row" id="form-row-activitytype"><label for="activitytype" class="control-label gcore-label-left">Activity type</label>
<div class="gcore-input gcore-display-table" id="fin-activitytype"><select name="activitytype" id="activitytype" size="" class="validate['required'] form-control A" title="" style="" data-load-state="" data-tooltip="">
<option value="document_reviewers">Document reviewers</option>
<option value="forums">Consumer and Community Forums and Conversations</option>
<option value="consumer_rep">Consumers and community members in research teams</option>
<option value="buddy">Research buddy</option>
<option value="ref_grp">Reference group</option>
<option value="steering_grp">Steering group</option>
<option value="ccres">Consumer and community researchers</option>
<option value="ccac">Consumer and community advisory council</option>
<option value="expo">Community expo</option>
<option value="psp">Priority setting partnership</option>