mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Merge pull request #4975 from ptica/disabled-hidden-input
Disable the hidden input for multi checkbox inputs when inputs are disabled.
This commit is contained in:
commit
5b32fd7e25
2 changed files with 4 additions and 3 deletions
|
@ -2695,7 +2695,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
array('label' => array('for' => "ContactMultiple")),
|
array('label' => array('for' => "ContactMultiple")),
|
||||||
'Multiple',
|
'Multiple',
|
||||||
'/label',
|
'/label',
|
||||||
array('input' => array('type' => 'hidden', 'name' => "data[Contact][multiple]", 'value' => '', 'id' => "ContactMultiple")),
|
array('input' => array('type' => 'hidden', 'name' => "data[Contact][multiple]", 'value' => '', 'id' => "ContactMultiple", 'disabled' => 'disabled')),
|
||||||
array('div' => array('class' => 'checkbox')),
|
array('div' => array('class' => 'checkbox')),
|
||||||
array('input' => array('type' => 'checkbox', 'name' => "data[Contact][multiple][]", 'value' => 1, 'disabled' => 'disabled', 'id' => "ContactMultiple1")),
|
array('input' => array('type' => 'checkbox', 'name' => "data[Contact][multiple][]", 'value' => 1, 'disabled' => 'disabled', 'id' => "ContactMultiple1")),
|
||||||
array('label' => array('for' => "ContactMultiple1")),
|
array('label' => array('for' => "ContactMultiple1")),
|
||||||
|
@ -5004,7 +5004,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'Multiple',
|
'Multiple',
|
||||||
'/label',
|
'/label',
|
||||||
'input' => array(
|
'input' => array(
|
||||||
'type' => 'hidden', 'name' => 'data[Contact][multiple]', 'value' => '', 'id' => 'ContactMultiple_'
|
'type' => 'hidden', 'name' => 'data[Contact][multiple]', 'value' => '', 'id' => 'ContactMultiple_', 'disabled' => 'disabled'
|
||||||
),
|
),
|
||||||
'select' => array(
|
'select' => array(
|
||||||
'name' => 'data[Contact][multiple][]', 'disabled' => 'disabled', 'multiple' => 'multiple', 'id' => 'ContactMultiple'
|
'name' => 'data[Contact][multiple][]', 'disabled' => 'disabled', 'multiple' => 'multiple', 'id' => 'ContactMultiple'
|
||||||
|
|
|
@ -2069,7 +2069,8 @@ class FormHelper extends AppHelper {
|
||||||
'id' => $attributes['id'] . ($style ? '' : '_'),
|
'id' => $attributes['id'] . ($style ? '' : '_'),
|
||||||
'secure' => false,
|
'secure' => false,
|
||||||
'form' => isset($attributes['form']) ? $attributes['form'] : null,
|
'form' => isset($attributes['form']) ? $attributes['form'] : null,
|
||||||
'name' => $attributes['name']
|
'name' => $attributes['name'],
|
||||||
|
'disabled' => $attributes['disabled'] === true || $attributes['disabled'] === 'disabled'
|
||||||
);
|
);
|
||||||
$select[] = $this->hidden(null, $hiddenAttributes);
|
$select[] = $this->hidden(null, $hiddenAttributes);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue