Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table id="scDetails" class="table">
- <thead>
- <tr>
- <th>Item</th>
- <th>IsChecked</th>
- <th>Comment</th>
- </tr>
- </thead>
- <tbody>
- @Html.EditorFor(m => m.Fbacks)
- </tbody>
- </table>
- <tr>
- <td>@Html.HiddenFor(m => m.Item)
- @Html.DisplayFor(m => m.Item)
- </td>
- <td>@Html.CheckBoxFor(m => m.IsChecked)</td>
- <td>@Html.TextBoxFor(m => m.Comment)</td>
- </tr>
- $('input[type=checkbox]').on('click', function() {
- var isChecked = $(this).is(':checked');
- $(this).parent().next().find('input[type="text"]').attr('disabled', !isChecked);
- });
- // OR
- $('input[type=checkbox]').on('click', function() {
- var isChecked = $(this).is(':checked');
- $(this).parent().parent().find('input[type="text"]').attr('disabled', !isChecked);
- });
- $("input[type='checkbox']").on("click", function() {
- $(this).parent().next().find("textarea").prop("disabled", ! this.checked);
- });
- $('#Fbacks').click (function ()
- {
- var thisCheck = $(this);
- if (thischeck.is (':checked'))
- {
- $('#Comment').prop('disabled', true);
- }else{
- $('#Comment').prop('disabled', false);
- }
- });
Add Comment
Please, Sign In to add comment