[PR #15093] Feat/14573 support more types in form #28259

Closed
opened 2026-02-21 20:43:06 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/15093

State: closed
Merged: Yes


Summary

Add more types in the markdown form.

Supported Types

enum SUPPORTED_TYPES {
  TEXT = 'text',
  PASSWORD = 'password',
  EMAIL = 'email',
  NUMBER = 'number',
  DATE = 'date',
  TIME = 'time',
  DATETIME = 'datetime',
  CHECKBOX = 'checkbox',
  SELECT = 'select',
}

Form Content

<form data-format="json"> // Default to text
  <label for="username">Username:</label>
  <input type="text" name="username" />
  <label for="password">Password:</label>
  <input type="password" name="password" />
  <label for="content">Content:</label>
  <textarea name="content"></textarea>
  <label for="date">Date:</label>
  <input type="date" name="date" />
  <label for="time">Time:</label>
  <input type="time" name="time" />
  <label for="datetime">Datetime:</label>
  <input type="datetime" name="datetime" />
  <label for="select">Select:</label>
  <input type="select" name="select" data-options='["hello","world"]'/>
  <input type="checkbox" name="check" data-tip="By checking this means you agreed"/>
  <button data-size="small" data-variant="primary">Login</button>
</form>

DSL File

ChatForm.yml.zip

Screenshots

Before After
old-types new-types

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/15093 **State:** closed **Merged:** Yes --- # Summary Add more types in the markdown form. ## Supported Types ``` enum SUPPORTED_TYPES { TEXT = 'text', PASSWORD = 'password', EMAIL = 'email', NUMBER = 'number', DATE = 'date', TIME = 'time', DATETIME = 'datetime', CHECKBOX = 'checkbox', SELECT = 'select', } ``` ## Form Content ``` <form data-format="json"> // Default to text <label for="username">Username:</label> <input type="text" name="username" /> <label for="password">Password:</label> <input type="password" name="password" /> <label for="content">Content:</label> <textarea name="content"></textarea> <label for="date">Date:</label> <input type="date" name="date" /> <label for="time">Time:</label> <input type="time" name="time" /> <label for="datetime">Datetime:</label> <input type="datetime" name="datetime" /> <label for="select">Select:</label> <input type="select" name="select" data-options='["hello","world"]'/> <input type="checkbox" name="check" data-tip="By checking this means you agreed"/> <button data-size="small" data-variant="primary">Login</button> </form> ``` ## DSL File [ChatForm.yml.zip](https://github.com/user-attachments/files/19103635/ChatForm.yml.zip) # Screenshots | Before | After | |--------|-------| | ![old-types](https://github.com/user-attachments/assets/a4d635e7-5187-41f8-b42c-da8d0a81b6f5) | ![new-types](https://github.com/user-attachments/assets/e1794271-0d54-4264-ae86-1d1149a81ebb) | # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:43:06 -05:00
yindo closed this issue 2026-02-21 20:43:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#28259