简体   繁体   中英

closing one jQuery UI modal dialog when another one clicked

When users want to sign in to the website, they click on the sign in link and the sign in form is displayed in a modal dialog.

There is also a forgot password link inside the sign in form in case users cant remember their password.

Forgot password form is also displayed in a modal dialog.

My problem is when users click on the forgot password link from the sign in modal dialog, another modal dialog (forgot password) opens on top of the existing sign in modal dialog.

Can sign in form modal dialog close when the forgot password modal dialog opens up?

Thanks!

                <div id="dialog_form_signin" class="hidden" title="<%=lngSigninForm%>">
                    <form action="content/myaccount/index.cs.asp?Process=SignIn" method="post" class="signin-form">
                        <fieldset>
                            <p>
                                <label><%=lngEmailAdd%></label>
                                <input type="text" name="EMAILADDRESS" size="55" value="" />
                                <small></small>
                            </p>
                            <p>
                                <label><%=lngPassword%></label>
                                <input type="password" name="PASSWORD" size="55" value="" />
                                <small></small>
                            </p>                                                            
                            <p>
                                <input type="hidden" name="x" value="p">   
                                <input type="submit" name="signin" value="<%=lngSubmit%>" class="submit" />
                            </p>
                            <p><a href="javascript:void(0)" id="open_forgotpass" class="reset"><img id="message" src="images/icons/help.png" alt="Message"> <%=lngPassRemind%></a></p>
                        </fieldset>
                    </form> 
                    </div>

    $( "#dialog_form_forgotpass" ).dialog({
        autoOpen: false,
        width: 400,
        modal: true
    });
    $("#open_forgotpass").click(function(){$( "#dialog_form_forgotpass" ).dialog( "open" );});
     $( "#dialog_form_signin" ).dialog({
        autoOpen: false,
        width: 400,
        modal: true
    });
    $("#open_signin").click(function(){$( "#dialog_form_signin" ).dialog( "open" );});

on forget password click , close sign-in dialog then open forget password dialog

 $("#open_forgotpass").click(function(){
    $( "#dialog_form_signin" ).dialog( "close" );
    $( "#dialog_form_forgotpass" ).dialog( "open" );

    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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