Advertisement
sspence65

clear check boxes

May 25th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1.  
  2.     echo '<script>
  3.  
  4.         function uncheck(){
  5.             var a=uncheck.arguments,z0=0;
  6.             for (;z0<a.length;z0++){
  7.                 document.getElementById(a[z0])?document.getElementById(a[z0]).checked=false:null;
  8.             }
  9.         }
  10.  
  11.         </script>';
  12.  
  13.  
  14.     echo '<input type="checkbox" id="addfile1" onClick="uncheck(\'clearAll\');" name="fileck1" value="1">Instructions<br>';
  15.  
  16.  
  17.     echo '<input type="checkbox" id="addfile2" onClick="uncheck(\'clearAll\');" name="fileck2" value="1">Wiring Diagram<br>';
  18.  
  19.  
  20.     echo '<input type="checkbox" id="addfile3" onClick="uncheck(\'clearAll\');" name="fileck3" value="1">File 3<br>';
  21.  
  22.  
  23.     echo '<input type="checkbox" id="addfile4" onClick="uncheck(\'clearAll\');" name="fileck4" value="1">File 4<br>';
  24.  
  25.  
  26.     echo '<input type="checkbox" id="addfile5" onClick="uncheck(\'clearAll\');" name="fileck5" value="1">Technical Drawing<p>';
  27.  
  28.     echo '<input type="checkbox" id="clearAll" onClick="uncheck(\'addfile1\',\'addfile2\',\'addfile3\',\'addfile4\',\'addfile5\');" name="clear" value="1" ><b>None of the above (clears above options)</b><br>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement