-1

My problem is that, the submit button is not working. As you can see, my partial view contains a jquery modal. If you click "mdlist" the modal will and appear with the submit button.

Can you please tell me whats the possible problem.

@model IEnumerable<MyApp.Models.Participant>
<link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>

<a id="mdlist" class="button" href="#"><span class="new icon"></span>Add Participant</a>
<div id="dialog" class="content-wrapper">
    <div class="buttons">
    <input type="submit" name="submitButton" value="Save" class="button save icon" />
    </div>
    <table cellspacing="0">
        <thead>
            <tr>
                <th>

                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Name)
                </th>
            </tr>
        </thead>

@foreach (var item in Model)
{
   <tbody>
     <tr>
        <td>
            <input type="checkbox" name="ParticipantCheck" id="@item.ID" />
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
    </tr>
   </tbody>
}
</table>
</div>
                <script type="text/javascript">
                $(function () {
                    $("#dialog").dialog({
                        autoOpen: false,
                        height: 400,
                        width: 670,
                        modal: true,
                        closeOnEscape: true,
                        resizeable: false
                    });
            </script>
ekad
  • 14,436
  • 26
  • 44
  • 46
user3035024
  • 199
  • 2
  • 5
  • 17

1 Answers1

0

First of all you need to add Form (submit button works only if there was a form) by

@using(@Html.BeginForm()){ 
//place your html elements and submit button here 
}

Next if you have an array the way you are adding checkboxes is incorrect take a look at this link

Reza
  • 18,865
  • 13
  • 88
  • 163