search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Insert another textarea

Related article: HTML5/JavaScript Event Calendar (Open-Source)
Asked by Woto
11 months ago.

Your example shows only one input field. How can you insert another textarea afterwards, which is then also saved?

Answer posted by Dan Letecky [DayPilot]
11 months ago.

You can use a custom modal dialog and add as many field as needed. Here is an example:

async function modalText() {

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

  const data = {
    name: "Default name"
  };

  const modal = await DayPilot.Modal.form(form, data);
  if (modal.canceled) {
     return null;
  }
  return modal.result;
}

You can also build the modal dialog using this online tool:
https://modal.daypilot.org/builder

See also:
https://modal.daypilot.org/documentation/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.