Multiple color edit "Displaying multiple color id
<select class="form-control" name="pro_color[]" multiple="multiple" id="color">
<?php
$colorid = $supplierSelectdata->pro_color; // here get color id
$explodevalue = explode(',',$colorid); // , alada kora hoiche
foreach ($color as $k=>$val) { // $color database theke ane index neya hoiche
$selected = '';
foreach($explodevalue as $key=>$view){
if($view == $val->color_id){
$selected .= "selected";
}
}
?>
<option <?php echo ($selected)? 'selected': '' ?> value="<?php echo $val->color_id; ?>"> <?php echo $val->color; ?></option>
<?php } ?>
</select>
Comments
Post a Comment