<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Check all checkboxes (javascript)</title>
	<atom:link href="http://www.sajithmr.me/check-all-checkboxes-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me/check-all-checkboxes-javascript</link>
	<description></description>
	<lastBuildDate>Fri, 27 Jan 2012 16:09:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: sreeram</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-345582</link>
		<dc:creator>sreeram</dc:creator>
		<pubDate>Thu, 15 Dec 2011 08:26:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-345582</guid>
		<description>Thanks for a such a valuable information........</description>
		<content:encoded><![CDATA[<p>Thanks for a such a valuable information&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr Me</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-299850</link>
		<dc:creator>Mr Me</dc:creator>
		<pubDate>Mon, 10 Oct 2011 07:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-299850</guid>
		<description>You can find some scripts here: http://www.iknowkungfoo.com/blog/index.cfm/2008/7/9/Check-All-Checkboxes-with-JQuery</description>
		<content:encoded><![CDATA[<p>You can find some scripts here: <a href="http://www.iknowkungfoo.com/blog/index.cfm/2008/7/9/Check-All-Checkboxes-with-JQuery" rel="nofollow">http://www.iknowkungfoo.com/blog/index.cfm/2008/7/9/Check-All-Checkboxes-with-JQuery</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mr Me</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-299847</link>
		<dc:creator>Mr Me</dc:creator>
		<pubDate>Mon, 10 Oct 2011 07:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-299847</guid>
		<description>The script I wrote is very old. You can simply do this using jQuery now, with a single line code :)</description>
		<content:encoded><![CDATA[<p>The script I wrote is very old. You can simply do this using jQuery now, with a single line code <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: atul</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-299792</link>
		<dc:creator>atul</dc:creator>
		<pubDate>Mon, 10 Oct 2011 05:29:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-299792</guid>
		<description>hi how can we select check box when they are dynamically craeted in nested foreach loops.................</description>
		<content:encoded><![CDATA[<p>hi how can we select check box when they are dynamically craeted in nested foreach loops&#8230;&#8230;&#8230;&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahdi Javaheripur</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-139170</link>
		<dc:creator>Mahdi Javaheripur</dc:creator>
		<pubDate>Wed, 10 Nov 2010 07:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-139170</guid>
		<description>Hi,

This can be hugely optimized for forms with a lot of checkboxes if you get inputs.length before the loop so the input.length won&#039;t be calculated in every iteration of the loop.

var inputsLength = inputs.length;
for (var i = 0; i &lt; inputsLength; i++)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This can be hugely optimized for forms with a lot of checkboxes if you get inputs.length before the loop so the input.length won&#8217;t be calculated in every iteration of the loop.</p>
<p>var inputsLength = inputs.length;<br />
for (var i = 0; i &lt; inputsLength; i++)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daxa</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-116839</link>
		<dc:creator>Daxa</dc:creator>
		<pubDate>Thu, 15 Jul 2010 06:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-116839</guid>
		<description>Its good.</description>
		<content:encoded><![CDATA[<p>Its good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Markie</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-86384</link>
		<dc:creator>Michael Markie</dc:creator>
		<pubDate>Wed, 18 Nov 2009 11:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-86384</guid>
		<description>This code can be cut down slightly by doing the following:

function checkAll(){
		var t = document.getElementsByTagName(&#039;input&#039;);
		for(var i in t)
			if(t[i].type==&#039;checkbox&#039;)
				t[i].checked=true;
	}</description>
		<content:encoded><![CDATA[<p>This code can be cut down slightly by doing the following:</p>
<p>function checkAll(){<br />
		var t = document.getElementsByTagName(&#8216;input&#8217;);<br />
		for(var i in t)<br />
			if(t[i].type==&#8217;checkbox&#8217;)<br />
				t[i].checked=true;<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khalid</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-73291</link>
		<dc:creator>Khalid</dc:creator>
		<pubDate>Mon, 06 Jul 2009 12:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-73291</guid>
		<description>THIS is the script I&#039;ve been searching for. Many Thanks!</description>
		<content:encoded><![CDATA[<p>THIS is the script I&#8217;ve been searching for. Many Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranjini</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-66135</link>
		<dc:creator>Ranjini</dc:creator>
		<pubDate>Thu, 14 May 2009 12:15:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-66135</guid>
		<description>I have a requirement where I need to pass the fields which have checkboxes to another page. Like if i have checkboxes on item field, i have to pass all those items(which are selected onclick of selectall button) to another page.</description>
		<content:encoded><![CDATA[<p>I have a requirement where I need to pass the fields which have checkboxes to another page. Like if i have checkboxes on item field, i have to pass all those items(which are selected onclick of selectall button) to another page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranjan</title>
		<link>http://www.sajithmr.me/check-all-checkboxes-javascript/comment-page-1#comment-43709</link>
		<dc:creator>Ranjan</dc:creator>
		<pubDate>Fri, 23 Jan 2009 05:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.sajithmr.com/check-all-checkboxes-javascript/#comment-43709</guid>
		<description>Hi Sajan ,

Here&#039;s modified code.
The logic is just check whether check box SelectAll is checked or not, if checked then select all else un select all.

Check for the name before you select it. 
here I have checked for name &quot;chk&quot; and type checkbox.

function checkAll() {
    var selectAll = document.getElementById(&#039;SelectAll&#039;);

    var inputs = document.getElementsByTagName(&#039;input&#039;);
    for (var i = 0; i &lt; inputs.length; i++) 
    {
        if (inputs[i].type == &#039;checkbox&#039; &amp;&amp; inputs[i].name == &quot;chk&quot;) {
            if(selectAll.checked==true)
                inputs[i].checked = true;
            else
                inputs[i].checked = false;
        }
    }
}</description>
		<content:encoded><![CDATA[<p>Hi Sajan ,</p>
<p>Here&#8217;s modified code.<br />
The logic is just check whether check box SelectAll is checked or not, if checked then select all else un select all.</p>
<p>Check for the name before you select it.<br />
here I have checked for name &#8220;chk&#8221; and type checkbox.</p>
<p>function checkAll() {<br />
    var selectAll = document.getElementById(&#8216;SelectAll&#8217;);</p>
<p>    var inputs = document.getElementsByTagName(&#8216;input&#8217;);<br />
    for (var i = 0; i &lt; inputs.length; i++)<br />
    {<br />
        if (inputs[i].type == &#8216;checkbox&#8217; &amp;&amp; inputs[i].name == &#8220;chk&#8221;) {<br />
            if(selectAll.checked==true)<br />
                inputs[i].checked = true;<br />
            else<br />
                inputs[i].checked = false;<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

