Boostrap小技巧

1、Boostrap模态框保存后隐藏

1 $("#vacationmodel").modal('hide');

2、Boostrap模态框保存后第二次点击显示旧数据

//在保存按钮事件执行末尾调用clearForm即可
clearForm($("#vacationForm"));、

//清空文本框内容
    function clearForm(form) {
        // input清空
        $(':input', form).each(function () {
            var type = this.type;
            var tag = this.tagName.toLowerCase(); // normalize case
            if (type == 'text' || type == 'password' || tag == 'textarea')
                this.value = "";
                // 多选checkboxes清空
                // select 下拉框清空
            else if (tag == 'select')
                this.selectedIndex = -1;
        });
    };

 

posted @ 2018-01-31 10:38  不是植物  阅读(195)  评论(0编辑  收藏  举报