> For the complete documentation index, see [llms.txt](https://alaniso-de.gitbook.io/alaf-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alaniso-de.gitbook.io/alaf-framework/untitled/untitled/signpad-input-feld.md).

# signpad input-Feld

> Das signpad - Input-Feld benötigt die Formular-Option "`onSubmit`"

```php
/**
 * Create a Bootstrap form field to enter a signature
 *
 * Creates the input and canvas group for an element with the correct classes for errors.
 *
 * ATTENTION: This function uses the form-open-option: 'onSubmit' => 'submitForm()'
 *
 * @param string $name        	
 * @param string $label        	
 * @param string $value        	
 * @param array $options        	
 * @return string
 */
public function signpad($name, $label = null, $value = null, array $options = []) {
  // ...
}
```

### Parameter für das "signpad" Input-Feld

| Name     |          | Beschreibung                                                                                                                                                                                                                                                                                                               |
| -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $name    |          | Name des Input-Feldes. Dieser wird beim Senden des Formulars in `$_GET` übergeben.                                                                                                                                                                                                                                         |
| $label   | optional | Feldüberschrift für das Eingabefeld. Wird kein `$label` übergeben, so wird `$name` als Label übernommen.                                                                                                                                                                                                                   |
| $value   | optional | Wert des Input-Feldes. Der übergebene Wert wird im Formular zur Bearbeitung ausgegeben. (z.B. eine bestehende Unterschrift)                                                                                                                                                                                                |
| $options | optional | <p>Array mit Optionen / Attributen zu einem input-Feld. Hier sind grundsätzlich alle HTML-Attribute erlaubt. <br>Weiterhin können interne Optionen eingetragen werden, welche die Darstellung des Input-Feldes beeinflussen. <br><a href="/pages/-La_ZqCaTGcWGL4-MvjG">Optionale Parameter für input-Felder</a></p><p></p> |

### Optionale Parameter für das "signpad" Input-Feld

Die folgenden Optionen sind speziell für das "signpad" Input-Feld und somit gruppiert unter dem Index "signpad"

| ID              | Wert(e)  | Beschreibung                                                                                                                                                                                                                                                                                                           |                                                                                                                                       |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| uid             | optional | <p>In einem Formular können mehrere "signpad" Felder verwendet werden. Dabei werden diese mit dem <code>HTML-Tag "id='xyz'"</code> unterschieden.</p><p>Hier kann die <strong>unique-ID</strong> extern vergeben werden. Falls nicht gesetzt, wird vom Formulargenerator eine <strong>unique-ID</strong> erstellt.</p> |                                                                                                                                       |
| height          | optional | Höhe des Unterschriftenfeldes inPixeln                                                                                                                                                                                                                                                                                 |                                                                                                                                       |
| penColor        | optional | <p>Farbe, in der auf der Zeichnungsfläche geschrieben wird.</p><p>z.B. '#111111'; // Schwarz</p>                                                                                                                                                                                                                       |                                                                                                                                       |
| backgroundcolor | optional | <p>Hintergrundfarbe der Zeichnungsfläche.</p><p>z.B. '#FFFFFF'; // Weiß</p>                                                                                                                                                                                                                                            |                                                                                                                                       |
| btnChangeColor  | optional | <p><code>true                                                                                                                                                                                                                                                                                                          | false</code> Soll die Schaltfläche zur Auswahl der Schriftfarbe eingeblendet werden?</p><p>Default: <code>false</code></p>            |
| btnResize       | optional | <p><code>true                                                                                                                                                                                                                                                                                                          | false</code> Soll die Schaltfläche zur Größenänderung der Zeichnungsfläche eingeblendet werden?</p><p>Default: <code>false</code></p> |

## Signature-Pad

Das "signpad" Input-Feld nutzt die Funktionen des "Signature Pad": <https://github.com/szimek/signature_pad>

Dort ist auch eine vollständige Dokumentation verfügbar!

## Beispiele

### Unterschriftenfeld

```php
// Das signpad benötigt die Formular-Option "onSubmit"

// Formular öffnen
$FormHtml [] = $FrmObj->horizontal ( [ 
				'onSubmit' => 'submitForm()',
				'left_column_class' => 'col-md-2',
				'left_column_offset_class' => 'col-md-offset-2',
				'right_column_class' => 'col-md-10',
				'action' => moduleUrl ( $this->_module_name, 'ANTRAG/save' ),
				'files' => 'files',
				'id' => 'DetailForm' 
] );

// Hier der Test mit dem Signature-Pad
$FormHtml [] = $FrmObj->signpad ( 'MeinSignaturePad', 'Unterschrift', null, [ 
		'helptext' => 'Bitte unterzeichnen sie hier:',
		'height' => 250,
		'title' => 'Bereich für die Unterschrift',
		'right_column_class' => $FrmObj->column_class [8],
		'signpad' => [ 
				'height' => 250,
				'penColor' => '#82cb27',
				'btnChangeColor' => true,
				'btnResize' => true 
		] 
] );

```

![Signpad mit Farbauswahl und Größenänderung](/files/-LgBrvv7HU8nyqRAGeiR)

## Hinweise

### bootstrap - Hinweis

* Bei der Verwendung von "bootstrap"-tabs oder "hidden"-Elementen wird das signpad nicht korrekt dargestellt, sodass die Eingabe nicht möglich ist!\
  Ein Aufruf der Funktion `resizeCanvas();` schafft hier Abhilfe!

```
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alaniso-de.gitbook.io/alaf-framework/untitled/untitled/signpad-input-feld.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
