Eines würde mich dann doch noch interessieren:
Kann man den einzelnen Feldern irgendwie Attribute wie "selected", "disabled" usw. mitgeben?
Derzeit schaut das bei mir so aus:
PHP-Code:
class ManipulateForm
{
public function CoastLoadFormField(Widget $objWidget, $strForm, $arrForm)
{
/* Modify the field with #id 17 in form with #id 3 */
if ($arrForm['id'] == '3' && $objWidget->id == '17') {
$arrOptions = array();
$arrOptions[] = array(
'value' => '',
'label' => '-- Bitte wählen Sie aus --'
);
foreach ($GLOBALS['costs'] as $cost) :
$arrOptions[] = array(
'value' => $cost['costs_name'].': '.$cost['costs_units'].' ('.$cost['costs_amount'].')',
'label' => $cost['costs_name'].': '.$cost['costs_units'].' ('.$cost['costs_amount'].')'
);
endforeach;
$objWidget->__set('options', serialize($arrOptions));
}
return $objWidget;
}
}
Auf dem ersten Eintrag hätte ich gerne ein "selected" und ein "disabled" sodass das HTML mir ausgibt:
HTML-Code:
<option selected disabled value="">-- Bitte wählen Sie aus --</option>
Hat jemand eine Idee?
Lesezeichen