<?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: 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>
	<lastBuildDate>Mon, 28 Feb 2011 21:30:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</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 &#8211; 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&#039;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(&#039;radio&#039;,radioGroup).find(function(r){ return r.checked; }));
}

&lt;a href=&quot;alert(is_radio_checked(&#039;frm_1&#039;,&#039;foo&#039;))&quot; rel=&quot;nofollow&quot;&gt;clicky testy&lt;/a&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Apologies &#8211; didn&#8217;t put code tags around the example above so it stripped out my html tags &#8211; 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(&#039;radio&#039;,radioGroup).find(function(r){ return r.checked; }));
}

&lt;a href=&quot;alert(is_radio_checked(&#039;frm_1&#039;,&#039;foo&#039;))&quot; rel=&quot;nofollow&quot;&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(&#8216;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 &quot;elements&quot; 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;$( &quot;#form input[type=checkbox]&quot; )...&lt;/code&gt;

The above pattern would select all check boxes that is a child of an element with an id of &quot;form&quot;.</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]" )...</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&#039;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>

