jeudi 21 avril 2016

How to disable Select one then disable it's from second in multi select dropdownlist

I'm using multiselect dropdowlist and i want to disable item which is select first dropdown list. I have lots of googling but not see any correct solution which i want.

my code below

<table>
<tr>
    <td>

        <select class="form-control" id="day_list_1" multiple="multiple" name="shift[day_list_1][]">
            <option value="Sunday">Sunday</option>
            <option value="Monday">Monday</option>
            <option value="Tuesday">Tuesday</option>
            <option value="Wednesday">Wednesday</option>
            <option value="Thursday">Thursday</option>
            <option value="Friday">Friday</option>
            <option value="Saturday">Saturday</option>
        </select>

    </td>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </td>
    <td>
        <select class="form-control" id="day_list_2" multiple="multiple" name="shift[day_list_2][]">
            <option value="Sunday">Sunday</option>
            <option value="Monday">Monday</option>
            <option value="Tuesday">Tuesday</option>
            <option value="Wednesday">Wednesday</option>
            <option value="Thursday">Thursday</option>
            <option value="Friday">Friday</option>
            <option value="Saturday">Saturday</option>
        </select>
    </td>
</tr>

<script src="http://ift.tt/1xDNnh9"></script>
<link href="~/Content/jquery.multiselect.css" rel="stylesheet" />
<script src="~/Scripts/jquery.multiselect.js"></script>

<style type="text/css">
    .form-control
    {
        width: 130px;
        height: 130px;
    }
</style>


<script>
    $('select[multiple]').multiselect({
        columns: 1,
        placeholder: 'Select options'
    });

    $(document).ready(function () {

    });
</script>

somthing like this how to disable dropdown options based on the previously selected dropdown values in multi select dropdown?

Aucun commentaire:

Enregistrer un commentaire