item selected in checkbox & show/hide

item selected in checkbox & show/hide

Hi I have the following code. this works only for one row. I want this should work for both rows & also if I select the top checkbox, then it should select all the checkboxes to show all items in the table. 
there are Qty & Option column, I want these item should not be visible until I select the checkbox. 

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">

  3. <head>
  4. <meta content="en-us" http-equiv="Content-Language" />
  5. <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  6. <title>Quotation New Design</title>
  7. <link href="css/bootstrap.min.css" rel="stylesheet">
  8. <script type="text/javascript" >
  9. function valueChanged()
  10. {
  11. if($(".checkezspeedkit").is(":checked"))   
  12. $(".qtyezspeedkit ").show();
  13. else
  14. $(".qtyezspeedkit").hide();
  15. }
  16. </script>
  17. <style type="text/css">
  18. .qtyezspeedkit {
  19. display:none;
  20. }
  21. .optionezspeedkit{
  22. display:none;
  23. }
  24. .qtyezspeedkitbluetooth{
  25. display:none;
  26. }
  27. .optionezspeedkitbluetooth{
  28. display:none;
  29. }
  30. </style>
  31. </head>

  32. <body>
  33. <div class="container">
  34.     <div class="row">
  35.         <div class="col-md-12">
  36.         <h4>Checkbox Test</h4>
  37.         <div class="table-responsive">
  38.               <table id="mytable" class="table table-bordred table-striped">
  39.                    <thead>
  40. <th><input type="checkbox" id="checkall" /></th>
  41. <th>Name</th>
  42. <th>Qty</th>
  43. <th>Option</th>
  44.                    </thead>
  45.     <tbody>
  46. <tr>
  47. <td><input type="checkbox" class="checkezspeedkit" name="chkezspeedkit" onchange="valueChanged()"/></td>
  48. <td>EZSpeed Kit</td>
  49. <td>
  50. <select name="Select1" style="width: 50px" class="qtyezspeedkit" >
  51. <option>1</option>
  52. <option>2</option>
  53. <option>3</option>
  54. <option>4</option>
  55. <option>5</option>
  56. <option>6</option>
  57. </select>
  58. </td>
  59. <td>
  60. <select name="Select2" style="width: 137px" class="qtyezspeedkit">
  61. <option>Please select</option>
  62. <option>Required</option>
  63. <option>Option</option>
  64. </select>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td><input type="checkbox" class="checkezenergykit" name="chkezspeedkitbluetooth" onchange="valueChanged()"/></td>
  69. <td>EZEnergy Kit</td>
  70. <td>
  71. <select name="Select1" style="width: 50px" class="qtyezspeedkitbluetooth" >
  72. <option>1</option>
  73. <option>2</option>
  74. <option>3</option>
  75. <option>4</option>
  76. <option>5</option>
  77. <option>6</option>
  78. </select>
  79. </td>
  80. <td>
  81. <select name="Select2" style="width: 137px" class="optionezspeedkitbluetooth" >
  82. <option>Please select</option>
  83. <option>Required</option>
  84. <option>Option</option>
  85. </select>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90.     </div>
  91.   </div>
  92. </div>
  93. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  94. <script src="js/bootstrap.min.js"></script>
  95. </body>
  96. </html>