SHOW:
|
|
- or go back to the newest paste.
1 | <tr> | |
2 | <td>PERUSAHAAN</td> | |
3 | <td>:</td> | |
4 | <td> | |
5 | <select name="id_partner" class="text" id="category"> | |
6 | - | <option value="<?php echo set_select('id_partner',$this->form_data->id_partner); ?>">-- Partner --</option> |
6 | + | <option value="<?php echo set_select('id_partner',$this->form_data->id_partner); ?>">-- Partner --</option><?php |
7 | - | <?php |
7 | + | $valYgDIpilih=$id_partner; |
8 | - | foreach ($category->result() as $row) |
8 | + | foreach ($category->result() as $row){ |
9 | - | echo "<option value='".$row->id_partner."'>".$row->name_partner."</option>"; |
9 | + | if($valYgDIpilih == $row->id_partner){ $sel ='selected';}else{$sel='';} |
10 | - | ?> |
10 | + | echo "<option $sel value='".$row->id_partner."'>".$row->name_partner. |
11 | "{$valYgDIpilih=$id_partner;".$row->id_partner."}". | |
12 | "</option>"; | |
13 | ||
14 | } | |
15 | ?> | |
16 | </select> | |
17 | <?php echo form_error('id_partner'); ?> | |
18 | </td> | |
19 | </tr> | |
20 | <tr> | |
21 | <td>TUJUAN</td> | |
22 | <td>:</td> | |
23 | <td> | |
24 | <select name="id_class_partner" id="subcategory"> | |
25 | <option value="<?php echo set_select('id_class_partner',$this->form_data->id_class_partner); ?>">-- Tujuan --</option> | |
26 | </select> | |
27 | <?php echo form_error('id_class_partner'); ?> | |
28 | </td> | |
29 | </tr> |