$ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
$ret[] = sprintf('<input type="checkbox" id="edit_%s" name="%s">', $id, $id);
} elseif ($info['type'] == 'select') {
+ $v = array('id="edit_'.$id.'"',
+ 'name="'.$id.'"');
+ if (array_key_exists('onchange',$info))
+ $v[] = sprintf('onchange="%s"', $info['onchange']);
+
$ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
- $ret[] = sprintf('<select id="edit_%s" name="%s">', $id, $id);
+ $ret[] = sprintf('<select %s>', implode(' ', $v));
if (is_array($info['options'])) $options = $info['options'];
else $options = query_db($info['options']);
foreach ($options as $row)