Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (Revision 10011) +++ t3lib/class.t3lib_tceforms.php (Arbeitskopie) @@ -883,8 +883,13 @@ $PA['label'] = $this->sL($PA['label']); // JavaScript code for event handlers: $PA['fieldChangeFunc'] = array(); - $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] = "TBE_EDITOR.fieldChanged('" . $table . "','" . $row['uid'] . "','" . $field . "','" . $PA['itemFormElName'] . "');"; - $PA['fieldChangeFunc']['alert'] = $alertMsgOnChange; + $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] = ''; + // replace the existing item, if only one allowed and already set + if (intval($PA['fieldConf']['config']['maxitems']) === 1) { + $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] .= "setFormValueManipulate('" . $PA['itemFormElName'] . "','Remove'); "; + } + $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] .= "TBE_EDITOR.fieldChanged('" . $table . "','" . $row['uid'] . "','" . $field . "','" . $PA['itemFormElName'] . "');"; + $PA['fieldChangeFunc']['alert'] = $alertMsgOnChange; // if this is the child of an inline type and it is the field creating the label if ($this->inline->isInlineChildAndLabelField($table, $field)) { $inlineObjectId = implode(