Textarea Field (Form)

The textarea field (type: "textarea") displays a text box in the modal form() dialog that lets you enter a multi-line string.

Textarea Field Properties

  • type ("textarea") - specifies the form field type
  • name (string) - the field name that will be displayed above the text box
  • id (string) - the path that specifies the source/target property of the data object
  • height (number) - forces a specific textarea height (in pixels); optional
  • disabled (boolean) - makes the text field disabled (inaccessible and read-only); optional
  • cssClass (string) - additional CSS class that will be applied to the form field; optional
  • onValidate (function) - a callback function used to validate the field value; optional

Example

import {Modal} from "@daypilot/modal";

// ...

async function textField() {

  const form = [
    {name: "Description", id: "description", type: "textarea"},
  ];

  const data = {
    description: ""
  };

  const modal = await Modal.form(form, data);
  console.log(modal);

}