Search code examples
javascriptasp.nethtmlasmx

modal popup not showing on top of another modal popup


Updated

I am trying to use modal as confirmation prompt on another modal but confirmation modal is not vissible on onclick. Here is the modals properties I set.

Parent Modal.

I am calling my parent modal in my asmx file and then I am calling my child modal function in an asmx file as well.

<div id="ShowDetails" class="popup" tabindex="-1" style="position:absolute;" role="dialog">
    <div class="panel panel-green">
        <div class="panel-heading">Parchase Request Details</div>
        <div class="panel-body">
            <div class=" col-md-12">
                <div class="form-inline">
                    <input id="pdid" style="display: none; width: 90PX; margin: 2px;" type="hidden" />
                    <%--<asp:HiddenField ID="PDId" runat="server" />--%>
                    <table class="table table-condensed">
                        <tr>
                            <td>
                                <input id="item" style="display: none; width: 90PX; margin: 2px;" /></td>
                            <td>
                                <input id="quantity" style="display: none; width: 90PX; margin: 2px;" />

                            </td>
                            <td>
                                <input id="eprice" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="make" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="discription" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>

                                <a id="DoneEditingbtn" role="button" onclick="DoneEditing()" style="color: #72c02c; display: none; width: 100PX; margin: 2px;">Update</a>
                            </td>
                            <td><a id="cancleediting" role="button" onclick="cancleeditingdetail()" style="color: #72c02c; display: none; width: 100PX; margin: 2px;">cancel</a>
                            </td>
                        </tr>
                    </table>
                    <table class="table table-condensed">
                        <thead>
                            <tr style="background-color: #01cc66;">
                                <th>Item Name</th>
                                <th>Quantity</th>
                                <th>Estimated Price</th>
                                <th>Make</th>
                                <th>Discription</th>
                                <th>Options</th>
                            </tr>
                        </thead>
                        <tbody id="tblgetdetails">
                        </tbody>
                    </table>
                    <div id="Alert"></div>
                </div>
            </div>
        </div>
        <span class="popup-btn-close" data-dismiss="modal">close</span>
    </div>
</div>

Confirmation Modal.

    <div id="ApproveMod" class="popup" style=" z-index:2; position:absolute; left: 50%; width: 40%; border: 10px solid #666;">
    <div class="col-lg-6">
        <i>Are you sure to Approve this data?</i>
    </div>
    <i id="pheadIdApp"></i>
    <i id="pbdIdApp"></i>
    <div class="col-lg-6">
        <a class="btn-u btn-u-red" href="#" role='button' style="text-align: center; width: 45%;" onclick="Approve()">Yes </a>
        <button class="btn-u btn-u-green-custom " style="text-align: center; width: 45%;" data-dismiss="modal">NO</button>
    </div>
</div>

The Parent modal is showing properly but when I click on parent modal button which should toggle child modal, is not working, In ASMX I have defined my child modal function on onclick as following.

<a role='button' class='form-control' onclick='AppModal(PHId+","+PBDId)'>Approve</a>

Here is the child calling approach I used in script.

function AppModal(phid,pbdid) {
        $("#pheadIdApp").val(phid);
        $("#pbdIdApp").val(pbdid);
        $("#ApproveMod").modal("show");
    }

It should work properly I have used it many times but now I am stuck and have no idea where I might have missed the trick any kind of help is much much apriciated.


Solution

  • Its Really Funny Yesterday I got an answer to my problem by you which was about the same problem and now I find you stuck here. Change your child modal position to relative and assign z-index value greater then 1040 which is for default layer.