微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我如何取消选择所有选项,但我应该能够在选择的 js 中使用 ajax 提交通知后进行选择?

如何解决我如何取消选择所有选项,但我应该能够在选择的 js 中使用 ajax 提交通知后进行选择?

[用户界面][1]

这是我的用户界面,通过通知后,我会自动想取消全选并再次打开以供选择 这是我使用 jquery ajax 的 JavaScript 代码通知通过后,我想更新所选的选择 [myjs][2]

function InsertNotify() {
alertify.confirm('Notify','Are you sure you want to send notification',function () { FNotify(); },function () { alertify.error('Cancel') });
function FNotify() {
    var notifyObj = {
        supporterid: $(".supporters").val(),HospitalUpdateId: $("#hiddenid").val()
    }
    $.ajax({
        url: "/Notify/InsertNotify",type: "POST",data: notifyObj,success: function (result) {
            toastr.success("The notification passed successfully");
            $("#dropdown").val('');
            $("#dropdown").trigger("chosen:updated");
        },error: function (result) {
            toastr.error("Error in sending notifications");
        }
    });
}

}

$("#dropdown").val('') 无效

这是我在前端的代码

  @Html.ListBoxFor(model => model.selectedArray,new MultiSelectList(Model.supporters,"Id","Name"),new { id = "dropdown",multiple = "multiple" })
            <input type="hidden" id="notifytabtype" name="Type" />
            <input type="hidden" id="notifytabid" name="Id" />
            <input type="hidden" id="notifyhospitalid" name="HospitalId" />
            <button class="btn btn-danger" value="Notify" style="width:60px;height:30px;" id="notifysubmit" onclick="submitter()">Notify</button>

$("#dropdown").chosen(); js显示

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。