forum

Home / DeveloperSection / Forums / Check condion before post page on button click in Jquery or JavaScript.

Check condion before post page on button click in Jquery or JavaScript.

Samuel Fernandes218202-Feb-2013

Hi Expert!

I want to check condition before post my page on button click in MVC 4 using JavaScript or JQuery. My Code as below

@using (Html.BeginForm("AttachmentList", "Home", FormMethod.Post, new
{
    @id = "PDFListDownload"
}))
{
    <div id="PDFAttachmentList">
        <table>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@Html.CheckBox("fileItem")
                        @Html.Hidden("fileId", item.AtttachmentID)
                    </td>
                    <td>@Html.DisplayTextFor(m => item.Description)
                    </td>
                </tr>
            }
            <tr>
                <td>
                    <input id="btnDownload" type="submit" value="Download"  />
                </td>
                <td>
                    <input id="btnCancel" type="button" value="Cancel" onclick="CloseDialog();" />
                </td>
            </tr>
        </table>
    </div>
}

How it I do? Please help me?

Thanks in advance


Updated on 02-Feb-2013

Can you answer this question?


Answer

1 Answers

Liked By