mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
3c7168c58c
commit
a5fd1561e8
2 changed files with 2 additions and 3 deletions
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue