ENHANCEMENT Clearer indication of setting disabled attribute in DropdownField->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@64556 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-10-20 10:52:47 +00:00
parent 719bc5dff4
commit 62a28cab64

View File

@ -92,9 +92,10 @@ class DropdownField extends FormField {
'class' => trim($this->extraClass()) ? $this->extraClass() : null,
'id' => $this->id(),
'name' => $this->name,
'disabled' => $this->disabled ? 'disabled' : null,
'tabindex' => $this->getTabIndex()
);
if($this->disabled) $attributes['disabled'] = 'disabled';
return $this->createTag('select', $attributes, $options);
}