<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ptocheia.net &#187; forms</title>
	<atom:link href="http://ptocheia.net/tag/forms/feed/" rel="self" type="application/rss+xml" />
	<link>http://ptocheia.net</link>
	<description>Android Hell is a Real Place</description>
	<lastBuildDate>Thu, 12 Jan 2012 18:59:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CakePHP Form Validation: Making Your Error Messages Change Color</title>
		<link>http://ptocheia.net/2009/09/03/cakephp-formvalidation-making-your-error-messages-change-color/</link>
		<comments>http://ptocheia.net/2009/09/03/cakephp-formvalidation-making-your-error-messages-change-color/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 22:47:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://ptocheia.net/?p=237</guid>
		<description><![CDATA[<p>When you build a form with Cake and have any sort of validation, it would be nice to have a means for the displayed error message to <a href="http://ptocheia.net/2009/09/03/cakephp-formvalidation-making-your-error-messages-change-color/"  >&#187;&#187;</a>]]></description>
			<content:encoded><![CDATA[<p>When you build a form with Cake and have any sort of validation, it would be nice to have a means for the displayed error message to distinguish itself from the rest of the text (in my particular case, making the text red). Unfortunately, Cake doesn&#8217;t seem to have anything built in to easily do this. After playing around with my Cake site for a bit, and doing some extensive Google searching for a simple solution (and coming up lacking), I realized something basic that would do the trick: setting the font color style for  &lt;form&gt; (or any enclosing element around &lt;form&gt;) to be the color of my error message, and setting the color for the elements within the form to be the regular text color.</p>
<p>This is working well enough for me for the css:</p>
<p><code><br />
	form{<br />
		color: #ff0000;<br />
	}<br />
	label{<br />
		color: #000;<br />
	}<br />
</code></p>
<p>This only works for displaying error messages though (or rather, for displaying a single message color). If you need a second color, you can probably set a session in your controller to represent a css style, which your view can use to determine which style should get used.  But then again, probably the only reason you&#8217;d want another color is for success messages, and those are mostly useful if you&#8217;re using Ajax, in which case you&#8217;ve got better means of message styling then the one I&#8217;ve posted here anyhow. </p>
]]></content:encoded>
			<wfw:commentRss>http://ptocheia.net/2009/09/03/cakephp-formvalidation-making-your-error-messages-change-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

