ENHANCEMENT Clearer indication of setting disabled attribute in CheckboxField->Field() since the disabled attribute shouldn't be set if the field isn't to be disabled

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64553 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-10-20 10:22:01 +00:00
parent 2fd43fccfa
commit a16f55b068

View File

@ -20,11 +20,11 @@ class CheckboxField extends FormField {
'id' => $this->id(),
'name' => $this->Name(),
'value' => 1,
'tabindex' => $this->getTabIndex(),
'checked' => $this->value ? 'checked' : '',
'disabled' => $this->disabled ? 'disabled' : '',
'tabindex' => $this->getTabIndex()
);
if($this->disabled) $attributes['disabled'] = 'disabled';
return $this->createTag('input', $attributes);
}