vendredi 29 mai 2015

Selecting all check boxes when only clicking one

enter image description here

How can I select all the check boxes on single click, while every check box has unique name using JavaScript? Please provide code.

 </div><!-- /.box-header -->
 <div class="box-body">
 <form name="permissionfrm" method="post" id="permissionfrm">
 <input type="hidden" name="permission" id="permission" value="assignpermission" />
  <table id="example1" class="table table-bordered table-striped">
    <thead>
     <tr>
      <th>Give All Permissions
      </th><td><input type="checkbox" name="addadmin" id="addadmin" value="Check All" onClick="this.value=check(this.form.list)"/></td>
      </tr>
      <tr>
        <th>Add</th>
        <th>Edit</th>
        <th>View</th>
        <th>Delete</th>
      </tr>
     </thead>
    <tbody>

Aucun commentaire:

Enregistrer un commentaire