Когда я использую выбранный класс, я не могу скрыть свой выпадающий - PullRequest
0 голосов
/ 13 марта 2020

<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.jquery.min.js"></script>
<link href="~/Content/Css/checkboxwithdropdown/chkwithdrop.css" rel="stylesheet" />
<link href="~/Content/js/checkbox/custom-checkbox.js" rel="stylesheet" />
<link href="~/Content/Css/jquery-ui.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/jquery-ui.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>



@*Script On Page Load Starts*@
<script type="text/javascript" >
    $(document).ready(function ()

    {
    
        $('#valCloudFolderSharing_ClassIds').hide();
        $('#valCloudFolderSharing_SectionIds').hide();
        $('#ClassLabel').hide();
        $('#SectionLabel').hide();
        $('#StaffLabel').hide();
        $('#valCloudFolderSharing_StaffIds').hide();
        $('#StudentLabel').hide();
        $('#valCloudFolderSharing_StudIds').hide();


      $(".chosen-select").chosen();
$('button').click(function(){
        $(".chosen-select").val('').trigger("chosen:updated");
});


    });
</script>



<script type="text/javascript">
    function IsOpen() {
    $("chosen-select").hide();
        $('#valCloudFolderSharing_ClassIds').hide();
        $('#valCloudFolderSharing_SectionIds').hide();
        //$('#valCloudFolderSharing_StaffIds').hide();
        $('#ClassLabel').hide();
        $('#SectionLabel').hide();
        $('#StaffLabel').hide();
        $('#valCloudFolderSharing_StaffIds').hide();
        $('#StudentLabel').hide();
        $('#valCloudFolderSharing_StudIds').hide();
        //$('#StaffLabel').hide();


    }
</script>


@*Script To Show Class Dropdown Only Starts*@
<script type="text/javascript">
    function Class() {
        $('#ClassLabel').show();
        $('#valCloudFolderSharing_ClassIds').show();
        $('#SectionLabel').hide();
        $('#valCloudFolderSharing_SectionIds').hide();
        $('#StaffLabel').hide();
        $('#valCloudFolderSharing_StaffIds').hide();
        $('#StudentLabel').hide();
        $('#valCloudFolderSharing_StudIds').hide();
        // $('#btnSubmit').show();
    }
</script>

@*Script To Show Class And Section Dropdown Only Starts*@
<script type="text/javascript">
    function Section() {
        $('#ClassLabel').show();
        $('#valCloudFolderSharing_ClassIds').show();
        $('#SectionLabel').show();
        $('#valCloudFolderSharing_SectionIds').show();
        $('#StaffLabel').hide();
        $('#valCloudFolderSharing_StaffIds').hide();
        $('#StudentLabel').hide();
        $('#valCloudFolderSharing_StudIds').hide();
        // $('#btnSubmit').show();
    }
</script>

@*Script To Show Staff Dropdown Only Starts*@
<script type="text/javascript">
    function Staff() {
        $('#ClassLabel').hide();
        $('#valCloudFolderSharing_ClassIds').hide();
        $('#SectionLabel').hide();
        $('#valCloudFolderSharing_SectionIds').hide();
        $('#StaffLabel').show();
        $('#valCloudFolderSharing_StaffIds').show();
        $('#StudentLabel').hide();
        $('#valCloudFolderSharing_StudIds').hide();
        // $('#btnSubmit').show();
    }
</script>

@*Script To Show Student Dropdown Only Starts*@
<script type="text/javascript">
    function Student() {
        $('#ClassLabel').show();
        $('#valCloudFolderSharing_ClassIds').show();
        $('#SectionLabel').show();
        $('#valCloudFolderSharing_SectionIds').show();
        $('#StaffLabel').hide();
        $('#valCloudFolderSharing_StaffIds').hide();
        $('#StudentLabel').show();
        $('#valCloudFolderSharing_StudIds').show();
        // $('#btnSubmit').show();
    }
</script>
  <div class="fc-div" style="margin-top:0px;">
            <div style="margin-top: 8px; margin-left:5px;">
                <label class="ar-label5">  <span class="chk2">@Html.RadioButton("rblColumn", "IsOpen", new { @onclick = "IsOpen();", @checked = "checked" })<span></span></span><span class="ar-span2">All</span></label>
                <label class="ar-label5">  <span class="chk2">@Html.RadioButton("rblColumn", "Class", new { @onclick = "Class();" })<span></span></span><span class="ar-span2">Class - wise </span></label>
                <label class="ar-label5">  <span class="chk2">@Html.RadioButton("rblColumn", "Section", new { @onclick = "Section();" })<span></span></span><span class="ar-span2">Section - wise </span></label>
                <label class="ar-label5">  <span class="chk2">@Html.RadioButton("rblColumn", "Staff", new { @onclick = "Staff();" })<span></span></span><span class="ar-span2">StaffName</span></label>
                <label class="ar-label5">  <span class="chk2">@Html.RadioButton("rblColumn", "Student", new { @onclick = "Student();" })<span></span></span><span class="ar-span2">StudentName</span></label>
            </div>
        </div>
        <div style="margin-top:15px; margin-bottom:10px; float:left;">
            <label class="fr-label" id="ClassLabel">Select Class</label>
            @Html.DropDownListFor(m => m.valCloudFolderSharing.ClassIds, new SelectList(Model.lstClass, "ClassId", "ClassName"), "All", new { @class = "chosen-select", multiple = "multiple", style = "width:200px;" })
        </div>


        <div style="margin-top:15px; margin-bottom:10px; float:left;">
            <label class="fr-label" style="margin-left:10px;" id="SectionLabel">Select Section</label>
            @Html.DropDownListFor(m => m.valCloudFolderSharing.SectionIds, ViewBag.SectionDrpLst as SelectList, "All", new { @class = "as-select", onchange = "GetStudentDetail(valStudentDetails_ClassId,this);" })
        </div>

        <div style="margin-top:15px; margin-bottom:10px; float:left;">
            <label class="fr-label" style="margin-left:10px;" id="StaffLabel">Select Staff</label>
            @Html.DropDownListFor(m => m.valCloudFolderSharing.StaffIds, new SelectList(Model.lstStaffDetails, "StaffId", "StaffName"), new { @class = "chosen-select", multiple = "multiple", style = "width:300px;" })
            @*@Html.DropDownListFor(m => m.valCloudFolderSharing.StaffIds, ViewBag.StaffName as SelectList, "All", new { @class = "as-select"})*@
        </div>



        <div style="margin-top:15px; margin-bottom:10px; float:left;">
            <label class="fr-label" style="margin-left:10px;" id="StudentLabel">Select Student</label>
            @Html.DropDownListFor(m => m.valCloudFolderSharing.StudIds, ViewBag.StudentDrpLst as SelectList, "All", new { @class = "as-select" })
        </div>
        <div class="form-div">
            <input type="submit" value="Submit" class="submit" />
        </div>
        <div class="form-div">
            <span style="margin-left: 35%;text-align:right">@Html.Raw(@TempData["ResultMsg"])</span>
        </div>
@ Html .RadioButton ("rblColumn", "IsOpen", new {@onclick = "IsOpen ();", @checked = "checked"}) Все @ Html .RadioButton ("rblColumn", "Class", new {@onclick = "Class ();"}) Класс - @ @ 1010 * .RadioButton ("rblColumn", "Section", new {@ onclick = "Section ();"}) Раздел - мудрый @ Html .RadioButton ("rblColumn", "Staff", new {@onclick = "Staff ();"}) StaffName @ Html .RadioButton (" rblColumn "," Student ", new {@onclick =" Student (); "}) StudentName
<div style="margin-top:15px; margin-bottom:10px; float:left;">
    <label class="fr-label" id="ClassLabel">Select Class</label>
    @Html.DropDownListFor(m => m.valCloudFolderSharing.ClassIds, new SelectList(Model.lstClass, "ClassId", "ClassName"), "All", new { @class = "chosen-select", multiple = "multiple", style = "width:200px;" })
</div>


<div style="margin-top:15px; margin-bottom:10px; float:left;">
    <label class="fr-label" style="margin-left:10px;" id="SectionLabel">Select Section</label>
    @Html.DropDownListFor(m => m.valCloudFolderSharing.SectionIds, ViewBag.SectionDrpLst as SelectList, "All", new { @class = "as-select", onchange = "GetStudentDetail(valStudentDetails_ClassId,this);" })
</div>

<div style="margin-top:15px; margin-bottom:10px; float:left;">
    <label class="fr-label" style="margin-left:10px;" id="StaffLabel">Select Staff</label>
    @Html.DropDownListFor(m => m.valCloudFolderSharing.StaffIds, new SelectList(Model.lstStaffDetails, "StaffId", "StaffName"), new { @class = "chosen-select", multiple = "multiple", style = "width:300px;" })
    @*@Html.DropDownListFor(m => m.valCloudFolderSharing.StaffIds, ViewBag.StaffName as SelectList, "All", new { @class = "as-select"})*@
</div>



<div style="margin-top:15px; margin-bottom:10px; float:left;">
    <label class="fr-label" style="margin-left:10px;" id="StudentLabel">Select Student</label>
    @Html.DropDownListFor(m => m.valCloudFolderSharing.StudIds, ViewBag.StudentDrpLst as SelectList, "All", new { @class = "as-select" })
</div>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...