form->getValue('tables');
if (!is_null($tables)) $selected = $tables->tablelist;
else $selected = array();
// Check if the selected value is an array
if (!is_array($selected)) $selected = array($selected);
foreach ($this->tablelist as $table) {
if (in_array($table, $selected)) $sel = 'checked="checked"';
else $sel = '';
?>