---
title: "Eigener Wizard mit userFunc / Javascript reagiert nicht"
url: "https://www.typo3.net/d/121804-eigener-wizard-mit-userfunc-javascript-reagiert-nicht"
source: "typo3.net"
tags: ["Backend","Frage"]
created: "2016-02-01"
last_reply: "2016-02-01"
replies: 0
solved: false
page: 1
pages: 1
lang: "de"
---

# Eigener Wizard mit userFunc / Javascript reagiert nicht

Backend · 0 Antworten · gestartet 2016-02-01

## Eröffnungsbeitrag

**poveli** · 2016-02-01 · [Beitrag #1](https://www.typo3.net/d/121804-eigener-wizard-mit-userfunc-javascript-reagiert-nicht/1)

Hallo Leute, ich habe von der TYPO3-Seite folgenden Code gefunden, der mir sehr weiterhelfen könnte, wenn er funktionieren würde: <https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/CommonProperties/FieldControl/Index.html>

```php
'weirdness' => array(
        'exclude' => 0,
        'label' => 'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tx_examples_haiku.weirdness',
        'config' => array(
                'type' => 'input',
                'size' => 10,
                'eval' => 'int',
                'wizards' => array(
                        'specialWizard' => array(
                                'type' => 'userFunc',
                                'userFunc' => 'Documentation\\Examples\\Userfuncs\\Tca->someWizard',
                                'params' => array(
                                        'color' => 'green'
                                )
                        )
                )
        )
),
```

```php
public function someWizard($PA, $fObj) {
        // Note that the information is passed by reference,
        // so it's possible to manipulate the field directly
        // Here we highlight the field with the color passed as parameter
        $backgroundColor = 'white';
        if (!empty($PA['params']['color'])) {
                $backgroundColor = $PA['params']['color'];
        }
        $PA['item'] = '<div style="background-color: ' . $backgroundColor . '; padding: 4px;">' . $PA['item'] . '</div>';

        // Assemble the wizard itself
        $output = '<div style="margin-top: 8px; margin-left: 4px;">';

        $commonJavascriptCalls = $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] . $PA['fieldChangeFunc']['typo3form.fieldGet'] . ' return false;';
        // Create the + button
        $onClick = "document." . $PA['formName'] . "['" . $PA['itemName'] . "'].value++; " . $commonJavascriptCalls;
        $output .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '" style="padding: 6px; border: 1px solid black; background-color: #999">+</a>';
        // Create the - button
        $onClick = "document." . $PA['formName'] . "['" . $PA['itemName'] . "'].value--; " . $commonJavascriptCalls;
        $output .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '" style="padding: 6px; border: 1px solid black; background-color: #999">-</a>';
        $output .= '</div>';
        return $output;
}
```

Es wird ein eigenes Input-Feld erzeugt, das mit + und - bedient werden kann. Das Feld wird angelegt, auch die Farbe grün wird angezeigt. Allerdings reagiert der Klick auf + und - überhaupt nicht. In der Browser-Konsole werden keine Fehler ausgeworfen. Ist es für die Version 7.6 veraltet?

Danke für euren Support.

---

Quelle: „Eigener Wizard mit userFunc / Javascript reagiert nicht“, typo3.net, https://www.typo3.net/d/121804-eigener-wizard-mit-userfunc-javascript-reagiert-nicht
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
