<?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/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Check All/None Checkboxes Using&#160;MooTools</title> <atom:link href="http://davidwalsh.name/check-all-none-checkboxes-using-mootools/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 09 Feb 2012 15:40:33 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: David Walsh</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-24389</link> <dc:creator>David Walsh</dc:creator> <pubDate>Fri, 10 Jun 2011 18:54:29 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-24389</guid> <description>Good suggestion, but that may get elements I don&#039;t want, so maybe:&lt;code&gt;$$(“input[type$=checkbox].check-me“)&lt;/code&gt;This post is quite old, maybe I should update it.</description> <content:encoded><![CDATA[<p>Good suggestion, but that may get elements I don&#8217;t want, so maybe:</p><p><code>$$(“input[type$=checkbox].check-me“)</code></p><p>This post is quite old, maybe I should update it.</p> ]]></content:encoded> </item> <item><title>By: Hevyweb</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-24382</link> <dc:creator>Hevyweb</dc:creator> <pubDate>Fri, 10 Jun 2011 11:08:27 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-24382</guid> <description>You should write $$(&quot;input[type$=checkbox]&quot;)... tra-la-la</description> <content:encoded><![CDATA[<p>You should write $$(&#8220;input[type$=checkbox]&#8220;)&#8230; tra-la-la</p> ]]></content:encoded> </item> <item><title>By: Adam</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-16643</link> <dc:creator>Adam</dc:creator> <pubDate>Fri, 26 Mar 2010 16:34:39 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-16643</guid> <description>@Adam:
My code above is flawed,ignore it, or David, please delete it :)Here&#039;s the code that works (shorter too!)@param container =&gt; The mootools representation of the element id that all the checkboxes are in. Eg &quot;#myElementId&quot;
@param obj =&gt; Set to &#039;this&#039;. That&#039;s because the onclick event should be on the checkbox that is the SelectAll/None, so &#039;this&#039; refers to the current state of this checkbox.function toggleCheckboxes(container,obj){
$$(container+&quot; input[type=checkbox]&quot;).each(function(el){
el.checked = obj.checked;
});
}</description> <content:encoded><![CDATA[<p>@Adam:<br
/> My code above is flawed,ignore it, or David, please delete it :)</p><p>Here&#8217;s the code that works (shorter too!)</p><p>@param container =&gt; The mootools representation of the element id that all the checkboxes are in. Eg &#8220;#myElementId&#8221;<br
/> @param obj =&gt; Set to &#8216;this&#8217;. That&#8217;s because the onclick event should be on the checkbox that is the SelectAll/None, so &#8216;this&#8217; refers to the current state of this checkbox.</p><p>function toggleCheckboxes(container,obj){<br
/> $$(container+&#8221; input[type=checkbox]&#8220;).each(function(el){<br
/> el.checked = obj.checked;<br
/> });<br
/> }</p> ]]></content:encoded> </item> <item><title>By: Adam</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-16069</link> <dc:creator>Adam</dc:creator> <pubDate>Thu, 11 Feb 2010 16:01:26 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-16069</guid> <description>Just incase anybody wants to do it without putting class names on all your checkboxes. Instead, stick an id on a html element that surrounds them all.
This is probably the answer to &quot;Farao&#039;s&quot; question.Set var yourContainer to be the id of the surrounding html element.
Example, if your container had an id of &quot;monkey&quot; then var yourContainer = &quot;#monkey&quot;. This way it only targets checkboxes in that area. It&#039;s a far better global solution than putting a class on each checkbox.This method takes the first checkbox found and uses it as a reference for the others to follow, to avoid mismatch checking.$$(yourContainer+&quot; input[type=checkbox]&quot;).each(function(el,c){
this.cbp = c==0?(el.checked?false:true):this.cbp;
el.checked = this.checkMe;
});Simplez.</description> <content:encoded><![CDATA[<p>Just incase anybody wants to do it without putting class names on all your checkboxes. Instead, stick an id on a html element that surrounds them all.<br
/> This is probably the answer to &#8220;Farao&#8217;s&#8221; question.</p><p>Set var yourContainer to be the id of the surrounding html element.<br
/> Example, if your container had an id of &#8220;monkey&#8221; then var yourContainer = &#8220;#monkey&#8221;. This way it only targets checkboxes in that area. It&#8217;s a far better global solution than putting a class on each checkbox.</p><p>This method takes the first checkbox found and uses it as a reference for the others to follow, to avoid mismatch checking.</p><p>$$(yourContainer+&#8221; input[type=checkbox]&#8220;).each(function(el,c){<br
/> this.cbp = c==0?(el.checked?false:true):this.cbp;<br
/> el.checked = this.checkMe;<br
/> });</p><p>Simplez.</p> ]]></content:encoded> </item> <item><title>By: Farao</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-12552</link> <dc:creator>Farao</dc:creator> <pubDate>Thu, 08 Oct 2009 21:29:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-12552</guid> <description>Very nice work!One question: what would you do if you have multiple tables, each inside its own form, and you want to check/uncheck only the checkboxes inside each particular table?</description> <content:encoded><![CDATA[<p>Very nice work!</p><p>One question: what would you do if you have multiple tables, each inside its own form, and you want to check/uncheck only the checkboxes inside each particular table?</p> ]]></content:encoded> </item> <item><title>By: John Boyd</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-11622</link> <dc:creator>John Boyd</dc:creator> <pubDate>Tue, 01 Sep 2009 02:08:30 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-11622</guid> <description>Finally someone who can make check all work with a name=&quot;xyz[]&quot;. Only issue is I tried to input your code and got error: &quot;object doesn&#039;t support this property or method&quot; and &quot;style is null or not an object&quot;.What did I miss here?</description> <content:encoded><![CDATA[<p>Finally someone who can make check all work with a name=&#8221;xyz[]&#8220;. Only issue is I tried to input your code and got error: &#8220;object doesn&#8217;t support this property or method&#8221; and &#8220;style is null or not an object&#8221;.</p><p>What did I miss here?</p> ]]></content:encoded> </item> <item><title>By: Joe</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-4523</link> <dc:creator>Joe</dc:creator> <pubDate>Mon, 12 Jan 2009 10:15:42 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-4523</guid> <description>Instead of:$(&#039;ucuc&#039;).addEvent(&#039;click&#039;, function() {
if($(&#039;ucuc&#039;).get(&#039;rel&#039;) == &#039;yes&#039;)
{
do&#095;check = false;
$(&#039;ucuc&#039;).set(&#039;src&#039;,&#039;checkboxes/uncheck.jpg&#039;).set(&#039;rel&#039;,&#039;no&#039;);
}
else
{
do&#095;check = true;
$(&#039;ucuc&#039;).set(&#039;src&#039;,&#039;checkboxes/check.jpg&#039;).set(&#039;rel&#039;,&#039;yes&#039;);
}
$$(&#039;.check-me&#039;).each(function(el) { el.checked = do&#095;check; });
});You could just do:$(&#039;ucuc&#039;).addEvent(&#039;click&#039;, function() {
$$(&#039;.check-me&#039;).set(&#039;checked&#039;,$(&#039;ucuc&#039;).getProperty(&#039;checked&#039;));
}); </description> <content:encoded><![CDATA[<p>Instead of:</p><p> $(&#8216;ucuc&#8217;).addEvent(&#8216;click&#8217;, function() {<br
/> if($(&#8216;ucuc&#8217;).get(&#8216;rel&#8217;) == &#8216;yes&#8217;)<br
/> {<br
/> do&#95;check = false;<br
/> $(&#8216;ucuc&#8217;).set(&#8216;src&#8217;,'checkboxes/uncheck.jpg&#8217;).set(&#8216;rel&#8217;,'no&#8217;);<br
/> }<br
/> else<br
/> {<br
/> do&#95;check = true;<br
/> $(&#8216;ucuc&#8217;).set(&#8216;src&#8217;,'checkboxes/check.jpg&#8217;).set(&#8216;rel&#8217;,'yes&#8217;);<br
/> }<br
/> $$(&#8216;.check-me&#8217;).each(function(el) { el.checked = do&#95;check; });<br
/> });</p><p>You could just do:</p><p>$(&#8216;ucuc&#8217;).addEvent(&#8216;click&#8217;, function() {<br
/> $$(&#8216;.check-me&#8217;).set(&#8216;checked&#8217;,$(&#8216;ucuc&#8217;).getProperty(&#8216;checked&#8217;));<br
/> });</p> ]]></content:encoded> </item> <item><title>By: jorge</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-2811</link> <dc:creator>jorge</dc:creator> <pubDate>Sat, 23 Aug 2008 16:55:33 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-2811</guid> <description>it would be interesant do this example with pagination, keeping the marked selection during page navigation. It could be with cookies...</description> <content:encoded><![CDATA[<p>it would be interesant do this example with pagination, keeping the marked selection during page navigation. It could be with cookies&#8230;</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-2490</link> <dc:creator>david</dc:creator> <pubDate>Tue, 29 Jul 2008 15:13:03 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-2490</guid> <description>&lt;p&gt;Thanks for the tips guys!&lt;/p&gt;</description> <content:encoded><![CDATA[<p>Thanks for the tips guys!</p> ]]></content:encoded> </item> <item><title>By: Elad Ossadon</title><link>http://davidwalsh.name/check-all-none-checkboxes-using-mootools/comment-page-1#comment-2488</link> <dc:creator>Elad Ossadon</dc:creator> <pubDate>Tue, 29 Jul 2008 14:04:19 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=325#comment-2488</guid> <description>$$(&#039;.check-me&#039;).each(function(el) { el.checked = do&#095;check; });could be$$(&#039;.check-me&#039;).set(&#039;checked&#039;,do&#095;check)Since all Element methods can be applied over instances of Elements class ($$ returns it). Those methods apply loops internally (see Elements.multi)
:)</description> <content:encoded><![CDATA[<p>$$(&#8216;.check-me&#8217;).each(function(el) { el.checked = do&#95;check; });</p><p>could be</p><p>$$(&#8216;.check-me&#8217;).set(&#8216;checked&#8217;,do&#95;check)</p><p>Since all Element methods can be applied over instances of Elements class ($$ returns it). Those methods apply loops internally (see Elements.multi)<br
/> :)</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 2/18 queries in 0.012 seconds using disk: basic
Object Caching 865/868 objects using disk: basic

Served from: davidwalsh.name @ 2012-02-09 11:54:49 -->
