提交表单后,模态窗口未关闭

时间:2016-04-09 01:03:42

标签: javascript jquery angularjs twitter-bootstrap twitter-bootstrap-3

我一直在努力使这项工作,但提交按钮根本不起作用。

每当我点击提交按钮时,模态窗口都没有关闭。

我使用的bootstrap模态窗口是:

HTML:

<div class="modal fade" id="like_Modal" role="dialog" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog modal-sm sr_popup">
        <div class="modal-content sr_popup_content">
            <div class="modal-header sr_pop_heading">
                <button class="close sr_popup_close" data-dismiss="modal"
                    type="button">&times;</button>
                <p class="modal-title sr_title">Save Likes to Favorites</p>
            </div>
            <div class="modal-body">
                <form name="favForm">
                    <div class="fm_panel">
                        <label class="formLabel">Name</label> <input class="form-control"
                            name="docTitle" type="text" value="{{documentTitle}}"
                            ng-maxlength="150" maxlength="150" required
                            ng-model="documentTitle"> <span
                            ng-show="favForm.docTitle.$error.required" style="color: red;">
                            The name is required.</span>
                    </div>
                    <br />
                    <button class="btn btn-default sr-submit-button" type="submit"
                        ng-click="saveBookmark(documentTitle, documentUrl);"
                        ng-disabled="!favForm.$valid">Save</button>
                </form>
            </div>
        </div>
    </div>
</div>

链接:

<a  href="" id="kb_rslts_img_add_to_like_{{$index}}" ng-click="saveTolikes(x.documenttitle, x.url);" data-keyboard="false" data-backdrop="static">

1 个答案:

答案 0 :(得分:0)

您可以使用以下代码行隐藏模态。

 $('#like_Modal').modal('hide');