I am trying following to make a dropdown readonly:
$element = $this->CreateElement('select', 'type');
$element->addMultiOptions( $Types );
$element->setRequired(true);
$element->setAttrib('readonly',true);
$element->setLabel('Type');
$elements[] = $element;
A dropdown is shown but I am able to select other values.
How to make a dropdown readonly ?
Thanks
You can use the read only attribute. You could avoid outputting a dropdown at all if it is not the best element to use in your particular case.