这是打开对话框的功能。我在对话框中打开html表单,但我尝试了所有的东西,但无法关闭模式弹出窗口。
function PopupDialog(id,title,height,width,draggable) {
$("#"+id).dialog({
modal: true,
title: title,
height: height,
width: width,
draggable: draggable,
stack: false,
});
}
我在模态弹出窗口中打开下面提到的div。
<div id="specialtyDetail">
<div class="fadeoutPatch0"></div>
<div class="fadeoutBackground" id="fbspecialtyDetail"></div>
<div id="tblspecialtyDetail" class="col-md-12">
<form method="get" id="frmSpecialtyDetail">
<!--start - CONTENTS-->
<div class="form-group">
<div class="col-md-6">
<label class="control-label">Short Name <span class="required">*</span></label>
<input class="form-control size100" name="ShortName" id="txtShortName" type="text" />
</div>
<div class="col-md-4 pad-a-labelsize">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" checked="" id="chkActive">
<label for="Active">Active</label>
</div>
</div>
<div class="col-md-10">
<label class="control-label">Description</label>
<input class="form-control" id="txtDescription" type="text" />
</div>
<div class="col-md-6 pad-a-labelsize-btn">
<div class="btn-block">
<button class="btn btn-primary btn-sm" type="reset" onclick="specialtyDetail.SpecialtySave_OnClick();">Save</button>
<button class="btn btn-primary btn-sm" type="reset" onclick="specialtyDetail.SpecialtyUnload();">Cancel</button>
</div>
</div>
</div>
</form>
</div>
我想在保存按钮点击时关闭对话框。
答案 0 :(得分:1)
此代码应该有效。使用id
调用此函数function closeDialog(id){
$("#"+id).dialog('close')
}