0
@model Stattips.Models.MatchesList

<br />

<div class="col-sm-8 container-fluid">
    <table class="table table-striped  ">
        <tr rowspan="3"><ul class="breadcrumb">
            <li><a href="#">Soccer</a></li>
            <li><a href="#">Albania</a></li>
            <li class="active">Kategoria Superiore</li>
        </ul></tr>

        <tr>

            <th>Matches</th>
            <th>Country</th>
            <th>Odds</th>

        </tr>

        @using (Html.BeginForm("AddMatches", "Matches"))
        {

            for (int i = 0; i < Model.Matches.Count(); i++)
            {

                <tr>

                    <td>
                        @Html.CheckBoxFor(m => Model.Matches[i].IsCheck)

                        @Model.Matches[i].HomeTeam-@Model.Matches[i].AwayTeam

                        @Html.HiddenFor(m => Model.Matches[i].HomeTeam)
                        @Html.HiddenFor(m => Model.Matches[i].AwayTeam)

                    </td>

                    <td>
                        @Model.Matches[i].Country
                        @Html.HiddenFor(m => Model.Matches[i].Country)

                    </td>

                    <td>

                        @Model.Matches[i].Odds
                        @Html.HiddenFor(m => Model.Matches[i].Odds)

                    </td>

                </tr>

            }

            <tr>
                <td>
                    <input type="Submit" value="Add" name="button1" id ="button1" class="btn btn-primary" />
                </td>
            </tr>
        }

        <tr>
            <td>
                <ul name="myselect" id="myselect"></ul>

            </td>
        </tr>

    </table>

</div>

<script>
    $('#button1').click(function(){
        $('#myselect').empty();
        $('checkbox.IsCheck').each(function () {
            var _row_data = $(this).parent().siblings().map(function(){
                return $(this).html();
            }).get().join('');
            $('#myselect').append('<li>' + _row_data + '</li>');
        });
    });
</script>

Edited by Stat_1

2
Contributors
1
Reply
14
Views
3 Months
Discussion Span
Last Post by rproffitt
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.