如何在form_multiselect的不同列中插入

时间:2019-05-07 05:55:51

标签: php codeigniter-3

我有表格规则结构: id_rule | kode_rule | rule_short |规则

在没有新选择规则的情况下更改任何rule_short时如何自动插入规则?

这是我的观点:

<?php echo form_error('rule_short');
$options = [];
foreach ($get_kondisi as $item) {
    $options[$item->kode_kondisi] = $item->kondisi;
}
echo form_multiselect($rule_short, $options, explode(",", $rule_short['value']));
?>
<?php echo form_error('rule');
$opsi = [];
foreach ($get_kondisi as $row) {
    $opsi[$row->kondisi] = $row->kondisi;
}
echo form_multiselect($rule, $opsi, explode(",", $rule['value']));

这是我的控制器

$this->data['rule_short'] = [
    'name'  => 'rule_short[]',
    'type'  => 'text',
    'value' => $this->form_validation->set_value('rule_short'),
    'class' => 'form-control show-tick',
    'data-live-search => 'true',
    $this->data['rule'] = array(
                    'name'          => 'rule[]',
                    'type'          => 'text',
                    'value'         => $this->form_validation->set_value('rule'),
                    'class '         => 'form - control',
                    'data - live - search' => 'true',
                );

0 个答案:

没有答案