Answer the question
In order to leave comments, you need to log in
How to store an array or string separated by commas?
Friends, hello everyone!
Tell me, how can I achieve the storage of a list of values in k2? In short, there is a parent field, now one value is written there, but several must be written separated by commas.
Values on the form are selected normally, but only one material is saved whose value is greater.
<div class="paramValue">
<select class="form-control" name="parent" id="parent" multiple="multiple" style="width:300px;">
<option value="0">Нет</option>
<?php foreach ($this->tags as $value): ?>
<option value="<?php echo $value->id; ?>" <?php echo $this->row->parent == $value->id ? 'selected' : ''; ?>>
<?php echo $value->name; ?>
</option>
<?php endforeach; ?>
</select>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question