Madhavan NR
Madhavan NR

Reputation: 188

Submit button inside JQM popup not hitting action method in MVC

My issue is that submit button which is placed inside Jquery Mobile popup and enclosed in Form Razor, when clicked, not hitting the Controller Action.

Find my code below:

Anchor tag which invokes div popup

<a data-role="none" data-theme="none" data-corners="false" style="text-decoration:none;" data-shadow="false" data-rel="popup" data-inline="true" href="#dvMPPopup" id="ancPopup_@i" class="ancQtyPopup">

The Div Popup

      @using (Html.BeginForm("AdjustQuantity", "ManualPickingSearch", FormMethod.Post, new { @id = "formAdjustQty" , data_ajax="false"}))
    {
    <div data-role="popup" data-position-to="window" data-theme="a" class="ui-content" id="dvDPPopup">
    <div class="ui-grid-d" style="text-align: center; padding-left: 5%">
        <div class="ui-block-a" style="width: 15%; padding-left: 3%">
            <div class="HwySearchlblStyle">Qty Picked</div>
        </div>
        <div class="ui-block-b" style="padding-left: 1%; width: 7%">
            @Html.TextBoxFor(Model => Model.PKQLTM, new { data_corners = "false", id = "txtDPPkd" })
        </div>
        <div class="ui-block-c" style="padding-left: 10%; width: 23%">
            <div class="HwySearchlblStyle">Process Password</div>
        </div>
        <div class="ui-block-d" style="padding-left: 5%; width: auto">
            <div>@Html.PasswordFor(Model => Model.Password, new { data_corners = "false" })</div>
        </div>

        <div class="ui-block-e" style="padding-left: 1%;">
            **<input type="submit" id="btnDpadjQty" name="btnpopups" class="HwyTaskIcon" data-role="none" value="" />**
        </div>
        <div id="errorMsg"></div>
    </div>
</div>}

The Controller Action Method

public ActionResult AdjustQuantity(...)
        {}

Plase help me guys , I have to solve this issue

Upvotes: 2

Views: 452

Answers (1)

Vivek Ranjan
Vivek Ranjan

Reputation: 1492

Just start your form after data-role="popup". That's it.

<div data-role="popup" data-position-to="window" data-theme="a" class="ui-content" id="dvDPPopup">
@using (Html.BeginForm("AdjustQuantity", "ManualPickingSearch", FormMethod.Post, new { @id = "formAdjustQty" , data_ajax="false"}))
{
//Your remaining code
}
</div>

Upvotes: 1

Related Questions