Loading multiple select drop down from data loader

awoolbert 25 Oct, 2011
I'm trying to find info on how to have the values selected in my Multiple Drop down list once the data is retrieved from the tables

I have a multi drop down called Category

When I load the data back to the form with the db record loader, I put in arrayfields sets Category and Array Separators as , . It loads the dropdown list, but doesn't select those fields that were stored in the tables.

I'm using Joomla 1.7 and the new ChronoForms V4
awoolbert 25 Oct, 2011
Please ignore - I found the bug fix in the forum and corrected

This is the line I added at line 165

// added explode
$field_value = explode(',', $data[$field_name]);

Here is where the code is located between

foreach($matches_options[0] as $matches_option){
$pattern_value = '/value=("|\')(.*?)("|\')/i';
preg_match($pattern_value, $matches_option, $matches_value);
$optionmatch = $matches_option;
//----------------------
// added explode -
$field_value = explode(',', $data[$field_name]);
//--------------------------------
if(in_array($matches_value[2], $field_value)){
$optionmatch = preg_replace('/<option/i', '<option selected="selected"', $matches_option);
}
$selectmatch = str_replace($matches_option, $optionmatch, $selectmatch);}
GreyHead 27 Oct, 2011
Hi awoolbert,

I think this is a ChronoForms bug, Please see this thread.

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