如何使選擇某一部分可以選擇多個或只有一個。下面是HTML選擇多隻允許一個選擇某些選項
<div class="bootstrap-select active_select col-sm-12 col-md-3 col-lg-3">
<select class="selectpicker" id="cron_dow" data-style="btn btn-success" name="cron_dow" required multiple>
//this 3 item can only be select only one, clear multiple selection if this any 3 item selected
<option value="*" class="only_one">Every Weekdays</option>
<option value="1,2,3,4,5" class="only_one">Monday - Friday</option>
<option value="0,6" class="only_one">Weekends</option>
//this 7 item can select multiple, clear above selection if selected
<option value="1" title="Weekday: Monday" >Monday</option>
<option value="2" title="Weekday: Tuesday" >Tuesday</option>
<option value="3" title="Weekday: Wednesday" >Wednesday</option>
<option value="4" title="Weekday: Thursday" >Thursday</option>
<option value="5" title="Weekday: Friday" >Friday</option>
<option value="6" title="Weekday: Saturday" >Saturday</option>
<option value="0" title="Weekday: Sunday" >Sunday</option>
</select>
</div>
有重複的帖子建議刪除多個屬性..這不是我的情況..前3只可以選擇一個(在代碼註釋),那麼它會清除任何其他的選擇。其他7週一至週日均可多選..