Guest User

Untitled

a guest
Jan 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <table id="scDetails" class="table">
  2. <thead>
  3. <tr>
  4. <th>Item</th>
  5. <th>IsChecked</th>
  6. <th>Comment</th>
  7. </tr>
  8. </thead>
  9. <tbody>
  10. @Html.EditorFor(m => m.Fbacks)
  11. </tbody>
  12. </table>
  13.  
  14. <tr>
  15. <td>@Html.HiddenFor(m => m.Item)
  16. @Html.DisplayFor(m => m.Item)
  17. </td>
  18. <td>@Html.CheckBoxFor(m => m.IsChecked)</td>
  19. <td>@Html.TextBoxFor(m => m.Comment)</td>
  20. </tr>
  21.  
  22. $('input[type=checkbox]').on('click', function() {
  23. var isChecked = $(this).is(':checked');
  24.  
  25. $(this).parent().next().find('input[type="text"]').attr('disabled', !isChecked);
  26. });
  27.  
  28. // OR
  29.  
  30. $('input[type=checkbox]').on('click', function() {
  31. var isChecked = $(this).is(':checked');
  32.  
  33. $(this).parent().parent().find('input[type="text"]').attr('disabled', !isChecked);
  34. });
  35.  
  36. $("input[type='checkbox']").on("click", function() {
  37. $(this).parent().next().find("textarea").prop("disabled", ! this.checked);
  38. });
  39.  
  40. $('#Fbacks').click (function ()
  41. {
  42. var thisCheck = $(this);
  43. if (thischeck.is (':checked'))
  44. {
  45. $('#Comment').prop('disabled', true);
  46. }else{
  47. $('#Comment').prop('disabled', false);
  48. }
  49. });
Add Comment
Please, Sign In to add comment