How to add multi select dropdown and comma seprated field from phtml in admin panel
-
13-12-2019 - |
Question
I am new to magento, I have to add multi select drop down and a comma separated field to magento admin panel using phtml file, can any one guide me for this. thanks...
Solution
you can add comma separated in option it like below
<?php $values='a,b,c,d,e';
$array=explode(',',$values);
?>
<select multiple name="option[]"> <?php foreach($array as $value)
{ ?>
<option value="<?php echo $value ?>"><?php echo $value ?></option>
<?php } ?>
</select>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange