Snap Builder Public Codes Library
Snap | Generators | Login | Browse | Search | Enter Code | Export Snap Builder Public Codes Library

 

Category: Javascript Codes Library >> Forms, Radio, Buttons, Check Box >> Check & Uncheck Form Boxes


Code Snippet </> Info


Snippet Name: Check & Uncheck Form Boxes

Description: Check and Uncheck Check Boxes easily with a click of the mouse.


Compatible Browsers:
Chrome BrowserFirefox BrowserInternet Explorer BrowserOpera BrowserSafari Browser


Example: View Code Demo

Note: Simply reword each input type to your own preference. Add/Delete as many as you need.

Author: SnapBuilder <snippets@snapbuilder.com>

Last Modified: 2019-12-09 02:40:13

Language: javascript

Highlight Mode: javascript

Copy Codes: Use Free Notepad ++
Bookmark and Share

Snap HTML Code Editor:
Paste the source code, make changes and instantly see it in live preview.
Snap HTML Code Editor


  About Copying
Copied To Clipboard!

<html> <head> <title>Check & Uncheck Check Boxes Javascript Code Snippet</title> <script> <!-- Begin Check & Uncheck Check Boxes from https://snapbuilder.com Free Public Codes Library // Free to use as long as the credit lines remain in place var checkflag = "false"; function check(field) { if (checkflag == "false") { for (i = 0; i < field.length; i++) { field[i].checked = true;} checkflag = "true"; return "Uncheck All"; } else { for (i = 0; i < field.length; i++) { field[i].checked = false; } checkflag = "false"; return "Check All"; } } // End --> </script> </head> <body> <center> <form name="myform" action="" method="post"> <table> <tr> <td><b>Your Favorite Scripts & Languages</b><br /> <input type="checkbox" name="list" value="1">jQuery<br> <input type="checkbox" name="list" value="2">Javascript<br /> <input type="checkbox" name="list" value="3">PHP<br /> <input type="checkbox" name="list" value="4">HTML<br /> <input type="checkbox" name="list" value="5">SQL<br /><br /> <input type="button" value="Check All" onClick="this.value=check(this.form.list)"></td> </tr> </table> </form> </center> </body> </html>


[ Snippet Options ]

 

© 2002 -  Snap Builder Public Codes Library