Click here to Skip to main content
15,913,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, i have code show below
HTML
<div>
                <table id="tblEnquire" class="table table-hover table-bordered table-striped table-responsive">
                    <thead>
                        <tr>
                            <th></th>
                            <th>Student Name</th>
                            <th>Course</th>
                            <th>Qualification</th>
                            <th>Contact</th>
                            <th>Email</th>
                            <th>Address</th>
                             <th>Remarks</th>
                        </tr>
                    </thead>
                    <tbody>
                        
                          @foreach(StudentsEnquire enqire in Model.StudentEnquire)
                          {
                              <tr>
                                  <td>@Html.CheckBox("status"+enqire.StudentId, new { value = enqire.StudentId, @class = "EnquireCheckBox" })</td>
                                  <td>@(enqire.SName)</td>
                                  <td>@(enqire.SCourse)</td>
                                  <td>@(enqire.SQualification)</td>
                                  <td>@(enqire.SContact)</td>
                                  <td>@(enqire.email)</td>
                                  <td>@(enqire.SAddress)</td>
                                  <td>@(enqire.Remarks)</td>
                              </tr>
                              @Html.Hidden("studentid",enqire.StudentId)
                          }
                        
                    </tbody>
                </table>
                <button type="button" class="btn btn-primary btn-xs" id="btnAddNewStudent" data-dissmiss="modal">Add New Student</button>
                <button type="button" class="btn btn-primary btn-xs" id="btnEditStudent" data-dissmiss="modal">Edit Student</button>
                <button type="button" class="btn btn-primary btn-xs" id="btnDeleteStudent" data-dissmiss="modal">Delete Student</button>
            </div>


if i click one checkbox and click on the EditStudent button then other dialog box will appear with values to edit them.
i'm trying to write a jquery for that as shown below
JavaScript
$('#btnEditStudent').click(function () {
       
            if ($('EnquireCheckBox').checked == true) {
                var value = $(this).val();
                data: $(this).val();
                $.ajax({

                    url: "/Students/UpdateStudent?StudentId="+data,
                    success: function (data) {
                        $('#testbody').html(data);
                        $('#myModal').modal('show');

                    }
                });
                
            }

            else if ($(this).prop("checked") == false) {


            }

        });


this jquery is not working.
Posted
Updated 22-Dec-15 20:20pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900