Added validation check to areaTag() with patch from Ticket #54 submitted by bgmccollum.

Note this will not work with the current Blog tutorial.
https://trac.cakephp.org/wiki/Cake/Tutorials/BlogPosts
We will update the tutorial with this change in next release.
Closes #54
Thanks bgmccollum

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@335 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-07-06 03:03:54 +00:00
parent 24c9c0478f
commit 7791b8dcfe

View file

@ -297,10 +297,13 @@ class HtmlHelper
*/
function areaTag($tag_name, $cols=60, $rows=10, $html_options=null)
{
$value = empty($html_options['value'])? $this->tagValue($tag_name): empty($html_options['value']);
$elements = explode("/", $tag_name);
$value = empty($html_options['value'])? $this->tagValue($elements[1]): empty($html_options['value']);
$html_options['cols'] = $cols;
$html_options['rows'] = $rows;
return sprintf(TAG_AREA, $tag_name, $this->parseHtmlOptions($html_options, null, ' '), $value);
$this->tagIsInvalid($elements[0],$elements[1])? $html_options['class'] = 'form_error': null;
return sprintf(TAG_AREA, $elements[1], $this->parseHtmlOptions($html_options, null, ' '), $value);
}
/**