简体   繁体   English

单击提交按钮时如何关闭jquery对话框(Submit按钮位于对话框内部)

[英]How to close a jquery dialog box when a submit button is clicked(Submit button is residing inside the dialog box)

i have struts2 form inside a jquery dialog box, when i submit my form inside that dialog box my Struts2 action is performing but that pop up jquery dialog box is not closing. 我在一个jquery对话框中有struts2表单,当我在该对话框中提交表单时,我的Struts2操作正在执行,但弹出的jquery对话框没有关闭。

How can i close that dialog box when![enter image description here][1] i submit my form? 何时可以关闭该对话框![在此处输入图片描述] [1]我提交表格?

 <table>
                    <tr>
                        <td>
                        <td align="center" >
                            <sj:head jqueryui="true" jquerytheme="cupertino" />

                            <sj:dialog 
                                id="mybuttondialog" 

                                autoOpen="false" 
                                showEffect="fadeIn" 
                                hideEffect="fadeOut" 
                                modal="true" 
                                title="Rename"
                                >
                                <s:form action="EditDayActionUserTemplate" id="formId323">
                                    <table style="height:48px;width: 100%;" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td colspan="2"  align="center">
                                                <input type="hidden" name="dayId" value="<%=daycont%>"/> 
                                                <input type="hidden" name="workoutId" value="<%=trid%>"/> 
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="50%" align="right"><font size="6px">Date</font></td>
                                            <td width="50%"> <sj:datepicker id="datghfe4" name="date" value="%{#parameters['date']}" label="Select Date" appendText=" (dd.MM.yy)" displayFormat="dd.M.yy"/></td>
                                        </tr>   
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td align="right"><sj:submit formIds="formId323" id="sdfdss3" button="true" value="Rename" targets="rightmiddiv"></sj:submit></td>
                                            </tr>
                                        </table>
                                </s:form> 
                            </sj:dialog>
                            <sj:submit 
                                openDialog="mybuttondialog" 
                                value="Rename" 
                                button="true"

                                />
                        </td>

                    </tr>
                </table>

Whenever you need to close the dialog box (programmatically I suppose) call the dialog method with argument close. 每当您需要关闭对话框(我想以编程方式)时,请使用参数close调用dialog方法。 Like this 像这样

$('#mybuttondialog').dialog('close');

Check this page for more info. 检查此页面以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM