【发布时间】:2020-02-05 12:34:00
【问题描述】:
我有一个带有列表和一些选项的模式。这些是从数据库中获取的。我需要用我在该模式中选择的内容制作一个列表/输入。我能做到吗?
这是我的清单:
<section>
<input type="text" class="form-control" id="populerNameKeyOrg" placeholder="Search for contacts" style="margin-top: 20px; margin-bottom: 20px; width: 38%">
<label class="select">
@if(isset($replyMessage))
@foreach($users->contact as $user)
<ul id="destPopulerOrg">
<li class="countryOrg"><input name="target_id[]" type="checkbox" value="{{ $user->id }}" <?php if(isset($replyMessage)){ if($replyMessage == $user->id) { echo "selected"; } } ?>><span>{{ $user->username }}</span></li>
<ul>
@endforeach
@endif
</label>
</section>
每个输入都有一个自己的 ID(用户 ID),就像这里的 <input name="target_id[]" type="checkbox" value="548">。因此,我需要使用在我的模式中选择的值(用户名)来制作类似于 Input 的东西。
【问题讨论】: