By default no radio element is checked (ticket #2963)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5540 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
dho 2007-08-17 09:15:19 +00:00
parent 3c7168c58c
commit a5fd1561e8
2 changed files with 2 additions and 3 deletions

View file

@ -741,9 +741,7 @@ class FormHelper extends AppHelper {
foreach ($options as $optValue => $optTitle) {
$optionsHere = array('value' => $optValue);
if (empty($value) && $count == 0) {
$optionsHere['checked'] = 'checked';
} elseif (!empty($value) && $optValue == $value) {
if (!empty($value) && $optValue == $value) {
$optionsHere['checked'] = 'checked';
}

View file

@ -453,6 +453,7 @@ class FormHelperTest extends CakeTestCase {
$this->assertPattern('/id="field_0"/', $result);
$this->assertPattern('/id="field_1"/', $result);
$this->assertNoPattern('/id="ModelField"/', $result);
$this->assertNoPattern('/checked="checked"/', $result);
}
function testSelect() {