Skip to content

Commit

Permalink
Added validation check to areaTag() with patch from Ticket #54 submit…
Browse files Browse the repository at this point in the history
…ted 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
  • Loading branch information
phpnut committed Jul 6, 2005
1 parent 24c9c04 commit 7791b8d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions libs/helpers/html.php
Expand Up @@ -295,13 +295,16 @@ function fileTag($tag_name, $html_options=null)
* @param array $html_options
* @return string
*/
function areaTag($tag_name, $cols=60, $rows=10, $html_options=null)
{
$value = empty($html_options['value'])? $this->tagValue($tag_name): empty($html_options['value']);
$html_options['cols'] = $cols;
$html_options['rows'] = $rows;
return sprintf(TAG_AREA, $tag_name, $this->parseHtmlOptions($html_options, null, ' '), $value);
}
function areaTag($tag_name, $cols=60, $rows=10, $html_options=null)
{
$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;
$this->tagIsInvalid($elements[0],$elements[1])? $html_options['class'] = 'form_error': null;
return sprintf(TAG_AREA, $elements[1], $this->parseHtmlOptions($html_options, null, ' '), $value);
}

/**
* Returns an INPUT element with type="checkbox". Checkedness is to be passed as string "checked" with the key "checked" in the $html_options array.
Expand Down

0 comments on commit 7791b8d

Please sign in to comment.