<?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"
	>
<channel>
	<title>Comments on: Validating check boxes and radio buttons with Prototype</title>
	<atom:link href="http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/</link>
	<description>Technology, Linux, FOSS, Music, Life and everything in between.</description>
	<pubDate>Tue, 07 Sep 2010 22:03:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Jon</title>
		<link>http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/#comment-27</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 12 May 2010 15:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.technopragmatics.org/?p=11#comment-27</guid>
		<description>OK - failed second time to get my example HTML to display :) Will explain briefly:

First parameter to the function is the ID attribute of the parent HTML FORM. Second parameter is the NAME of the INPUT TYPE=RADIO group in question.

You need to include the prototype.js library before calling this function!</description>
		<content:encoded><![CDATA[<p>OK - failed second time to get my example HTML to display :) Will explain briefly:</p>
<p>First parameter to the function is the ID attribute of the parent HTML FORM. Second parameter is the NAME of the INPUT TYPE=RADIO group in question.</p>
<p>You need to include the prototype.js library before calling this function!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/#comment-26</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 12 May 2010 15:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.technopragmatics.org/?p=11#comment-26</guid>
		<description>Apologies - didn't put code tags around the example above so it stripped out my html tags - will try again:

&lt;code&gt;

    option 1
    option 2



function is_radio_checked(formId,radioGroup)
{
   return Boolean($(formId).getInputs('radio',radioGroup).find(function(r){ return r.checked; }));
}

&lt;a href="alert(is_radio_checked('frm_1','foo'))" rel="nofollow"&gt;clicky testy&lt;/a&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Apologies - didn&#8217;t put code tags around the example above so it stripped out my html tags - will try again:</p>
<p><code></p>
<p>    option 1<br />
    option 2</p>
<p>function is_radio_checked(formId,radioGroup)<br />
{<br />
   return Boolean($(formId).getInputs('radio',radioGroup).find(function(r){ return r.checked; }));<br />
}</p>
<p><a href="alert(is_radio_checked('frm_1','foo'))" rel="nofollow">clicky testy</a><br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/#comment-25</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 12 May 2010 15:52:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.technopragmatics.org/?p=11#comment-25</guid>
		<description>Thanks for this. Alternative way to do it without element selectors is as follows:


    option 1
    option 2



function is_radio_checked(formId,radioGroup)
{
   return Boolean($(formId).getInputs('radio',radioGroup).find(function(r){ return r.checked; }));
}

&lt;a href="alert(is_radio_checked('frm_1','foo'))" rel="nofollow"&gt;clicky testy&lt;/a&gt;

See also: http://xavisys.com/using-prototype-javascript-to-get-the-value-of-a-radio-group/</description>
		<content:encoded><![CDATA[<p>Thanks for this. Alternative way to do it without element selectors is as follows:</p>
<p>    option 1<br />
    option 2</p>
<p>function is_radio_checked(formId,radioGroup)<br />
{<br />
   return Boolean($(formId).getInputs(&#8217;radio&#8217;,radioGroup).find(function(r){ return r.checked; }));<br />
}</p>
<p><a href="alert(is_radio_checked('frm_1','foo'))" rel="nofollow">clicky testy</a></p>
<p>See also: <a href="http://xavisys.com/using-prototype-javascript-to-get-the-value-of-a-radio-group/" rel="nofollow">http://xavisys.com/using-prototype-javascript-to-get-the-value-of-a-radio-group/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kchr</title>
		<link>http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/#comment-21</link>
		<dc:creator>kchr</dc:creator>
		<pubDate>Tue, 22 Dec 2009 10:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.technopragmatics.org/?p=11#comment-21</guid>
		<description>Hi Leo,

Thanks for your feedback. I assumed the readers have some basic knowledge about the Prototype framework and how to work with element selectors.

You simply replace the "elements" string with your own selector pattern for matching check boxes or radio buttons. The return value of my oneliner will be boolean true/false depending on whether or not at least one of the elements that you have matched upon is checked.

Example selector:

&lt;code=js&gt;$( "#form input[type=checkbox]" )...&lt;/code&gt;

The above pattern would select all check boxes that is a child of an element with an id of "form".</description>
		<content:encoded><![CDATA[<p>Hi Leo,</p>
<p>Thanks for your feedback. I assumed the readers have some basic knowledge about the Prototype framework and how to work with element selectors.</p>
<p>You simply replace the &#8220;elements&#8221; string with your own selector pattern for matching check boxes or radio buttons. The return value of my oneliner will be boolean true/false depending on whether or not at least one of the elements that you have matched upon is checked.</p>
<p>Example selector:</p>
<p><code =js>$( "#form input[type=checkbox]&#8221; )&#8230;</code></p>
<p>The above pattern would select all check boxes that is a child of an element with an id of &#8220;form&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo</title>
		<link>http://blog.technopragmatics.org/2008/11/validating-check-boxes-and-radio-buttons-with-prototype/#comment-17</link>
		<dc:creator>Leo</dc:creator>
		<pubDate>Fri, 27 Nov 2009 15:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.technopragmatics.org/?p=11#comment-17</guid>
		<description>It sucks, it's nothign if you dont post examples on how to use it!</description>
		<content:encoded><![CDATA[<p>It sucks, it&#8217;s nothign if you dont post examples on how to use it!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->