<?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: How to create an input field without a label</title>
	<atom:link href="http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-175276</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 24 Sep 2010 14:30:42 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-175276</guid>
		<description>@faten: I&#039;m not sure I understand you correctly, but have a look at the &lt;a href=&quot;http://api.cakephp.org/class/form-helper#method-FormHelpererror&quot; rel=&quot;nofollow&quot;&gt;error()&lt;/a&gt; method of the FormHelper. By using this helper method you can display the error message anywhere you want. 

I hope this answers your question. If not, please post some code, for example a snippet of the html you want to create.</description>
		<content:encoded><![CDATA[<p>@faten: I&#8217;m not sure I understand you correctly, but have a look at the <a href="http://api.cakephp.org/class/form-helper#method-FormHelpererror" rel="nofollow">error()</a> method of the FormHelper. By using this helper method you can display the error message anywhere you want. </p>
<p>I hope this answers your question. If not, please post some code, for example a snippet of the html you want to create.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: faten</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-175005</link>
		<dc:creator>faten</dc:creator>
		<pubDate>Wed, 22 Sep 2010 06:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-175005</guid>
		<description>Sorry, i was pointing to Krishna problem</description>
		<content:encoded><![CDATA[<p>Sorry, i was pointing to Krishna problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: faten</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-175004</link>
		<dc:creator>faten</dc:creator>
		<pubDate>Wed, 22 Sep 2010 06:33:13 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-175004</guid>
		<description>my problem as Axel but i want to know if there any other way to display validate message from model in red without put the error message as Axel&#039;s did


User Name:

Please enter the username
</description>
		<content:encoded><![CDATA[<p>my problem as Axel but i want to know if there any other way to display validate message from model in red without put the error message as Axel&#8217;s did</p>
<p>User Name:</p>
<p>Please enter the username</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-142928</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Mon, 28 Dec 2009 15:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-142928</guid>
		<description>@Axel: You are welcome :)</description>
		<content:encoded><![CDATA[<p>@Axel: You are welcome :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Axel</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-142766</link>
		<dc:creator>Axel</dc:creator>
		<pubDate>Fri, 25 Dec 2009 16:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-142766</guid>
		<description>easy, thank you!</description>
		<content:encoded><![CDATA[<p>easy, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-142549</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Mon, 21 Dec 2009 16:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-142549</guid>
		<description>@Krishna: Hm, what did you try to make it red? Did you try it in the way shown below?
&lt;pre&gt;
&lt;code&gt;
.error-message {color: red;}
&lt;/code&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Krishna: Hm, what did you try to make it red? Did you try it in the way shown below?</p>
<pre>
<code>.error-message {color: red;}</code>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-142446</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Sat, 19 Dec 2009 14:15:12 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-142446</guid>
		<description>Thanks for your suggestion. I would appreciate it if you could give a clue about this.
I have been trying to validate form using cakephp. Basically in the model i have validation code like this:
&lt;code&gt;
	var $validate = array(
    	&#039;username&#039;=&gt;array(
    		&#039;rule&#039;=&gt;&#039;alphaNumeric&#039;,
			&#039;required&#039;=&gt;true,
    		&#039;message&#039;=&gt;&#039;Please enter the username&#039;,
    	)
	);
&lt;/code&gt;
and in the view i have this:
&lt;code&gt;
&lt;h2&gt;Add User&lt;/h2&gt;
&lt;?php echo $form-&gt;create(&#039;User&#039;, array(&#039;url&#039; =&gt; &#039;/users/add&#039;));?&gt;
&lt;?php echo $form-&gt;input(&#039;username&#039;, array(&#039;size&#039; =&gt; &#039;20&#039;,&#039;label&#039;=&gt;&#039;User Name:&#039;));?&gt;
&lt;?php
echo &#039;&lt;div&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt; or &#039;.$html-&gt;link(&#039;Cancel&#039;, array(&#039;action&#039; =&gt; &#039;index&#039;)).&#039;&lt;/div&gt;&#039;;
echo $form-&gt;end();
?&gt;
&lt;code&gt;
&lt;h2&gt;Add User&lt;/h2&gt;
&lt;?php echo $form-&gt;create(&#039;User&#039;, array(&#039;url&#039; =&gt; &#039;/users/add&#039;));?&gt;
&lt;?php echo $form-&gt;input(&#039;username&#039;, array(&#039;size&#039; =&gt; &#039;20&#039;,&#039;label&#039;=&gt;&#039;User Name:&#039;));?&gt;
&lt;?php
echo &#039;&lt;div&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt; or &#039;.$html-&gt;link(&#039;Cancel&#039;, array(&#039;action&#039; =&gt; &#039;index&#039;)).&#039;&lt;/div&gt;&#039;;
echo $form-&gt;end();
?&gt;
&lt;/code&gt;
When I hit submit with empty usename i get the error message &#039;Please enter the username&#039; but it is always black. I was trying to make it red, but could not succeed. I noticed the problem was with class=&#039;required&#039; as seen in the view source:
&lt;code&gt;
&lt;form method=&quot;post&quot; action=&quot;/AuthUsers/users/add&quot;&gt;
&lt;fieldset style=&quot;display:none;&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;POST&quot; /&gt;
&lt;/fieldset&gt;
&lt;div class=&quot;input text required error&quot;&gt;
&lt;label for=&quot;UserUsername&quot;&gt;User Name:&lt;/label&gt;
&lt;input name=&quot;data[User][username]&quot; type=&quot;text&quot; size=&quot;20&quot; maxlength=&quot;20&quot; value=&quot;&quot; id=&quot;UserUsername&quot; class=&quot;form-error&quot; /&gt;
&lt;div class=&quot;error-message&quot;&gt;Please enter the username&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt; or &lt;a href=&quot;/AuthUsers/users&quot;&gt;Cancel&lt;/a&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/code&gt;

Anny clue as to how i can have the error message displayed in red color but the label in black color?
Krishna</description>
		<content:encoded><![CDATA[<p>Thanks for your suggestion. I would appreciate it if you could give a clue about this.<br />
I have been trying to validate form using cakephp. Basically in the model i have validation code like this:<br />
<pre><code>var $validate = array(
    	'username'=&gt;array(
    		'rule'=&gt;'alphaNumeric',
			'required'=&gt;true,
    		'message'=&gt;'Please enter the username',
    	)
	);</code></pre><br />
and in the view i have this:<br />
<pre><code>&lt;h2&gt;Add User&lt;/h2&gt;
&lt;?php echo $form-&gt;create('User', array('url' =&gt; '/users/add'));?&gt;
&lt;?php echo $form-&gt;input('username', array('size' =&gt; '20','label'=&gt;'User Name:'));?&gt;
&lt;?php
echo '&lt;div&gt;&lt;input type="submit" value="Submit" /&gt; or '.$html-&gt;link('Cancel', array('action' =&gt; 'index')).'&lt;/div&gt;';
echo $form-&gt;end();
?&gt;
&lt;code&gt;
&lt;h2&gt;Add User&lt;/h2&gt;
&lt;?php echo $form-&gt;create('User', array('url' =&gt; '/users/add'));?&gt;
&lt;?php echo $form-&gt;input('username', array('size' =&gt; '20','label'=&gt;'User Name:'));?&gt;
&lt;?php
echo '&lt;div&gt;&lt;input type="submit" value="Submit" /&gt; or '.$html-&gt;link('Cancel', array('action' =&gt; 'index')).'&lt;/div&gt;';
echo $form-&gt;end();
?&gt;</code></pre><br />
When I hit submit with empty usename i get the error message &#8216;Please enter the username&#8217; but it is always black. I was trying to make it red, but could not succeed. I noticed the problem was with class=&#8217;required&#8217; as seen in the view source:<br />
<pre><code>&lt;form method="post" action="/AuthUsers/users/add"&gt;
&lt;fieldset style="display:none;"&gt;
&lt;input type="hidden" name="_method" value="POST" /&gt;
&lt;/fieldset&gt;
&lt;div class="input text required error"&gt;
&lt;label for="UserUsername"&gt;User Name:&lt;/label&gt;
&lt;input name="data[User][username]" type="text" size="20" maxlength="20" value="" id="UserUsername" class="form-error" /&gt;
&lt;div class="error-message"&gt;Please enter the username&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;input type="submit" value="Submit" /&gt; or &lt;a href="/AuthUsers/users"&gt;Cancel&lt;/a&gt;
&lt;/div&gt;
&lt;/form&gt;</code></pre>
<p>Anny clue as to how i can have the error message displayed in red color but the label in black color?<br />
Krishna</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-92374</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Mon, 02 Jun 2008 14:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-92374</guid>
		<description>@Jon: Thanks for your explanation, now it is clear what you meant. I hope I can fix it.

Anyway, good luck on your journey :)</description>
		<content:encoded><![CDATA[<p>@Jon: Thanks for your explanation, now it is clear what you meant. I hope I can fix it.</p>
<p>Anyway, good luck on your journey :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-91862</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Fri, 30 May 2008 17:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-91862</guid>
		<description>@cakebaker: Thanks for your suggestions.

re: post back - I wrote out a whole comment, about as long as the last one, but when I submitted, I forgot the mand. fields.  I got a message saying to fill the mand. fields, but the message just stayed there (it was the only thing on the screen) and I wasn&#039;t redirected back to my post.  I clicked back button and my writing was gone and I had to re-write.  

Thanks again for your responses and your blog.  It&#039;s an excellent resource for someone like me who&#039;s beginning what seems to be a long journey in php programming, and the cake framework.</description>
		<content:encoded><![CDATA[<p>@cakebaker: Thanks for your suggestions.</p>
<p>re: post back &#8211; I wrote out a whole comment, about as long as the last one, but when I submitted, I forgot the mand. fields.  I got a message saying to fill the mand. fields, but the message just stayed there (it was the only thing on the screen) and I wasn&#8217;t redirected back to my post.  I clicked back button and my writing was gone and I had to re-write.  </p>
<p>Thanks again for your responses and your blog.  It&#8217;s an excellent resource for someone like me who&#8217;s beginning what seems to be a long journey in php programming, and the cake framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/comment-page-1/#comment-91856</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 30 May 2008 15:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/03/01/how-to-create-an-input-field-without-a-label/#comment-91856</guid>
		<description>@Jon: I&#039;m not aware of such an alias function. Maybe it is worth to open an enhancement ticket for Inflector::underscore() to make it more sophisticated. But I&#039;m not sure whether this will get implemented, so I think it is probably easier to write a custom helper, which internally calls the FormHelper in the way shown in my previous comment.

Regarding configuration model, I would probably create a model for each configuration table, and then have a special configurations controller. But at first I would ask myself whether this additional complexity is really necessary and worth the effort.

What do you mean with &quot;post back method&quot;?</description>
		<content:encoded><![CDATA[<p>@Jon: I&#8217;m not aware of such an alias function. Maybe it is worth to open an enhancement ticket for Inflector::underscore() to make it more sophisticated. But I&#8217;m not sure whether this will get implemented, so I think it is probably easier to write a custom helper, which internally calls the FormHelper in the way shown in my previous comment.</p>
<p>Regarding configuration model, I would probably create a model for each configuration table, and then have a special configurations controller. But at first I would ask myself whether this additional complexity is really necessary and worth the effort.</p>
<p>What do you mean with &#8220;post back method&#8221;?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

