Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions checkboxes set to true using JavaScript
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
checkboxes set to true using JavaScript
3 Answer(s)      4 years and 2 months ago
Posted in : JavaScript Questions


To set all checkboxes to true using JavaScript?


Advertisement
View Answers

November 10, 2010 at 12:36 PM


We can use following code to set all the checkboxes to true using javaScript.

Gyan
Singh
Ankit
Kumar
Kaushal



November 10, 2010 at 12:36 PM


We can use following code to set all the checkboxes to true using javaScript.

Gyan
Singh
Ankit
Kumar
Kaushal



November 10, 2010 at 12:37 PM


<head>
<script type="text/javascript">
function SelectAll() {
var checkboxes = document.getElementsByTagName("input");
for(i=0;i<checkboxes.length;i++) {
if(checkboxes.item(i).attributes["type"].value == "checkbox") {
checkboxes.item(i).checked = true;
}
}
}
function deSelectAll() {
var checkboxes = document.getElementsByTagName("input");
for(i=0;i<checkboxes.length;i++) {
if(checkboxes.item(i).attributes["type"].value == "checkbox") {
checkboxes.item(i).checked = false;
}
}
}
</script>
</head>
<body>
<input type="checkbox" name="list" value="1">Gyan<br>
<input type="checkbox" name="list" value="2">Singh<br>
<input type="checkbox" name="list" value="3">Ankit<br>
<input type="checkbox" name="list" value="4">Kumar<br>
<input type="checkbox" name="list" value="5">Kaushal<br>
<input type="submit" value="checkAll" onclick="SelectAll()" />
<input type="submit" value="uncheckAll" onclick="deSelectAll()" />

</body>


Related Tutorials/Questions & Answers:
checkboxes set to true using JavaScript
checkboxes set to true using JavaScript  To set all checkboxes to true using JavaScript
set the focus on an element using Javascript
set the focus on an element using Javascript  How to set the focus on an element using Javascript
Advertisements
JavaScript Array of checkboxes
JavaScript Array of checkboxes   ... that help you in understanding JavaScript Array of checkboxes. For this we are using JavaScript as Script language. In this example we make a HTML form
how to display selected checkboxes dynamically using jsp
how to display selected checkboxes dynamically using jsp  Hi friends i have a requirement that : in my JSP page i have radio buttons followed by the DB fields..when i click SUBMIT button,if the field(or record
property in javascript get set
property in javascript get set  How to create the get and set property in JavaScript?   Creating Get and Set properties in JavaScript example.. myVar Sample = { nval : "", get get() { return this.nval; }, set
Maintaining States of Selected CheckBoxes in Different Pages using dispaly table in struts2
Maintaining States of Selected CheckBoxes in Different Pages using dispaly... me how to maintain States of Selected CheckBoxes in Different Pages using... i am showing the list using a displaytag.Each row in the list has a checkbox
javascript set scroll height
javascript set scroll height  How to set scroll height in JavaScript?   CSS Scroll Method div { width:150px; height:150px; overflow:scroll; } JavaScript ScrollTo method <script type="text/javascript">
How to use Sigma grid built-in capabilities to calculate aggregates where Sortable property set to TRUE
Sortable property set to TRUE  How to use Sigma grid built-in capabilities to calculate aggregates where Sortable property set to TRUE, So that We can also...: but here Sortable property has been set to false. I need to implement
Updating multiple value depending on checkboxes
Updating multiple value depending on checkboxes  Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes..? please answer if any one knows as soon as possible
send mail using JavaScript
send mail using JavaScript  How can we send mail using JavaScript?   Hi friends, You can not send email directly using JavaScript. But you can use JavaScript to execute a client side email program send the email using
Date object using JavaScript
Date object using JavaScript  What's the Date object using JavaScript
delete an entry using JavaScript
delete an entry using JavaScript  How to delete an entry using JavaScript
using for loop in javascript
using for loop in javascript  How to use for loop in JavaScript
How to insert multiple checkboxes into Msaccess database J2EE using prepared statement - Java Beginners
How to insert multiple checkboxes into Msaccess database J2EE using prepared statement  Dear Experts, Tried as I might looking for solutions to resolve my Servlet problem, I still can't resolve it. Hope that you can share
timer using javascript
timer using javascript  How to display timer on HTML page using JavaScript
xls to js using javascript
xls to js using javascript  ![how can we convert a xls file in js file using javascript][1
maximize an image using javaScript
maximize an image using javaScript  Write the code to maximize an image using javaScript
List of checkboxes - JSP-Servlet
or more checkboxes are checked and the delete button is clicked...', true
how to set values from parent page to iframe in javascript
how to set values from parent page to iframe in javascript  how to set values from parent page to iframe in javascript pls reply me as possible as I am in great trouble
How to shift and unshift using JavaScript?
How to shift and unshift using JavaScript?  How to shift and unshift using JavaScript
java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement
java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement  hi class...(arg[0]); System.out.println(true num%2==0); System.out.println(false num
Array of checkboxes - Struts
Array of checkboxes  How to handle unknown number of checkboxes using tag in an ActionForm.   Hi friend, Code for multiple checkbox import javax.servlet.http.HttpServletRequest; import
The checkboxes tag
In this section, you will learn about checkboxes tag of Spring form tag library
validate radio button using javascript
validate radio button using javascript  validate radio button using javascript
convert numbers to strings using JavaScript
convert numbers to strings using JavaScript  How to convert numbers to strings using JavaScript
Math Constants and Functions using JavaScript
Math Constants and Functions using JavaScript  What's Math Constants and Functions using JavaScript
associate functions with objects using JavaScript
associate functions with objects using JavaScript  How to associate functions with objects using JavaScript
read and write a file using javascript
read and write a file using javascript  How to read and write a file using javascript
php return true false
php return true false  i wanted to create php function that returns true/false
javascript date validation using regex
javascript date validation using regex  Hi, I want to validate the date using javascript. Please help.   <html> <head> <title>Validating Date format</title> <script type="text/javascript">
Jsp-delete checked checkboxes and display UNCHECKED checkboxes in table as well as in store that unchecked checkboxes in ARRAYLIST
Jsp-delete checked checkboxes and display UNCHECKED checkboxes in table as well as in store that unchecked checkboxes in ARRAYLIST  I have a table... checkboxes should be displayed. And we should keep remaining checkboxes
 

 

 

DMCA.com