Question Types

md2form supports a rich variety of question types to meet various form requirements. This page provides detailed explanations of all question types and their usage.

Text Input

short_text - Short Text Input

A single-line text input field. Used for short strings such as names and titles.

### Your Name
 
#type short_text
#placeholder "John Doe"
#required true
#maxLength 50

Supported Properties:

  • placeholder: Placeholder text
  • maxLength: Maximum number of characters
  • default: Default value
  • required: Required input
  • visible: Show/hide

long_text - Long Text Input

A multi-line text input field. Used for comments, opinions, and detailed descriptions.

### Feedback/Suggestions
 
#type long_text
#placeholder "Please feel free to write"
#maxLength 1000
#richText true

Supported Properties:

  • placeholder: Placeholder text
  • maxLength: Maximum number of characters
  • default: Default value
  • richText: Enable rich text editing
  • required: Required input
  • visible: Show/hide

email - Email Address Input

A specialized input field for email addresses. Automatic format validation is performed.

### Email Address
 
#type email
#placeholder "example@example.com"
#required true
#allowMultiple false

Supported Properties:

  • placeholder: Placeholder text
  • default: Default value
  • allowMultiple: Allow multiple email addresses
  • required: Required input
  • visible: Show/hide

phone - Phone Number Input

A specialized input field for phone numbers.

### Phone Number
 
#type phone
#placeholder "123-456-7890"
#countryCodeRequired false

Supported Properties:

  • placeholder: Placeholder text
  • countryCodeRequired: Require country code
  • default: Default value
  • required: Required input
  • visible: Show/hide

Numeric Input

number - Numeric Input

A specialized input field for numbers. Used for numeric data such as age, price, and quantity.

### Age
 
#type number
#min 0
#max 120
#step 1
#placeholder "Enter a number"
#integerOnly true

Supported Properties:

  • placeholder: Placeholder text
  • min: Minimum value
  • max: Maximum value
  • step: Increment value
  • default: Default value
  • integerOnly: Allow only integers
  • required: Required input
  • visible: Show/hide

Selection

A dropdown menu field for selecting one choice from multiple options.

### State/Province
 
#type dropdown
#options "California","Texas","New York","Florida","Other"
#searchable true
#allowOther false

Supported Properties:

  • options: List of choices (comma-separated)
  • allowOther: Allow “Other” choice
  • default: Default selected value
  • searchable: Enable search functionality
  • required: Required selection
  • visible: Show/hide

radio - Radio Button Selection

A single selection field using radio buttons. Best for forms with few choices.

### Gender
 
#type radio
#options "Male","Female","Other","Prefer not to say"
#allowOther false

Supported Properties:

  • options: List of choices (comma-separated)
  • allowOther: Allow “Other” choice
  • default: Default selected value
  • required: Required selection
  • visible: Show/hide

checkbox - Checkbox Selection

A multiple selection field using checkboxes.

### Areas of Interest
 
#type checkbox
#options "AI/Machine Learning","Web Development","Mobile Apps","Data Science","Design"
#minSelected 1
#maxSelected 3

Supported Properties:

  • options: List of choices (comma-separated)
  • minSelected: Minimum number of selections
  • maxSelected: Maximum number of selections
  • default: Default selected values list
  • required: Required selection
  • visible: Show/hide

Date/Time

date - Date Selection

A date selection field.

### Date of Birth
 
#type date
#includeTime false
#minDate "1900-01-01"
#maxDate "2024-12-31"

Supported Properties:

  • includeTime: Whether to include time
  • minDate: Minimum date (ISO format)
  • maxDate: Maximum date (ISO format)
  • default: Default date
  • required: Required input
  • visible: Show/hide

time - Time Selection

A time selection field.

### Preferred Time
 
#type time
#minTime "09:00"
#maxTime "18:00"
#stepMinutes 30

Supported Properties:

  • minTime: Minimum time (“HH:MM” format)
  • maxTime: Maximum time (“HH:MM” format)
  • stepMinutes: Time increment (minutes)
  • default: Default time
  • required: Required input
  • visible: Show/hide

Rating/Scale

rating - Star Rating

A rating field using star icons.

### Service Satisfaction
 
#type rating
#scale 5
#labels "Dissatisfied","Very Satisfied"
#icon star

Supported Properties:

  • scale: Number of rating levels (e.g., 5-point scale)
  • labels: Labels for lowest and highest ratings
  • icon: Icon type (star, heart, circle)
  • default: Default rating
  • required: Required input
  • visible: Show/hide

likert - Likert Scale

A field for rating multiple items on a single scale.

### Course Evaluation
 
#type likert
#statements "Clarity of content","Teaching quality","Material completeness","Exercise appropriateness"
#scaleLabels "Strongly Disagree","Disagree","Neutral","Agree","Strongly Agree"
#requiredPerStatement true

Supported Properties:

  • statements: List of rating items
  • scaleLabels: List of scale labels
  • requiredPerStatement: Rate each item as required
  • required: Required input
  • visible: Show/hide

matrix - Matrix (Grid)

A field for rating and selection using a combination of rows and columns.

### Weekly Schedule
 
#type matrix
#rows "Monday","Tuesday","Wednesday","Thursday","Friday"
#columns "Morning","Afternoon","Evening"
#cellType radio
#requiredPerRow true

Supported Properties:

  • rows: List of row labels
  • columns: List of column labels
  • cellType: Cell type (radio, checkbox, number, short_text)
  • requiredPerRow: Each row requires input
  • required: Required input
  • visible: Show/hide

scale - Scale (Slider)

A slider field for rating on a numeric scale.

### English Level Self-Assessment
 
#type scale
#min 1
#max 10
#step 1
#minLabel "Beginner"
#maxLabel "Native Level"

Supported Properties:

  • min: Minimum value
  • max: Maximum value
  • step: Increment value
  • minLabel: Label for minimum value
  • maxLabel: Label for maximum value
  • default: Default value
  • required: Required input
  • visible: Show/hide

File/Signature

file_upload - File Upload

File upload functionality.

### Resume Upload
 
#type file_upload
#allowedTypes "pdf","docx","doc"
#maxFiles 1
#maxSizeMB 10

Supported Properties:

  • allowedTypes: Allowed file formats
  • maxFiles: Maximum number of files
  • maxSizeMB: Maximum file size (MB)
  • required: Required upload
  • visible: Show/hide

signature - Digital Signature

A field for capturing digital signatures.

### Digital Signature
 
#type signature
#captureMode draw
#required true

Supported Properties:

  • captureMode: Signature capture method (draw, type, upload)
  • required: Required signature
  • visible: Show/hide

Media/Display

image - Image Display

A field for displaying images (display only, not input).

### Product Image
 
#type image
#src "https://example.com/product.jpg"
#alt "Product photo"
#width 300
#caption "Product Preview"

Supported Properties:

  • src: Image URL
  • alt: Alternative text
  • width: Width (pixels or “auto”)
  • height: Height (pixels or “auto”)
  • caption: Caption
  • visible: Show/hide

video - Video Display

A field for displaying videos (display only, not input).

### Explanation Video
 
#type video
#src "https://example.com/explanation.mp4"
#width 400
#caption "Service Introduction Video"

Supported Properties:

  • src: Video URL
  • width: Width (pixels or “auto”)
  • height: Height (pixels or “auto”)
  • caption: Caption
  • visible: Show/hide

Other

boolean - Yes/No Selection

A yes/no (true/false) selection field.

### Email Subscription
 
#type boolean
#onLabel "Yes, subscribe"
#offLabel "No thanks"
#default false

Supported Properties:

  • onLabel: Label for true state
  • offLabel: Label for false state
  • default: Default value
  • required: Required selection
  • visible: Show/hide

section_header - Section Header

A display-only heading within a section.

### Important Notice
 
#type section_header
#title "About Personal Information Handling"
#subtitle "Please read the following information carefully"

Supported Properties:

  • title: Main title
  • subtitle: Subtitle
  • visible: Show/hide

Guide to Selecting Question Types

Text Input Selection

  • short_text: Names, titles, short answers (single line)
  • long_text: Opinions, comments, detailed explanations (multiple lines)
  • email: Email addresses (with format validation)
  • phone: Phone numbers

Selection Type Selection

  • radio: Few choices (2-5) for single selection
  • dropdown: Many choices (6+) for single selection
  • checkbox: When multiple selections are needed

Rating Type Selection

  • rating: Intuitive star rating (single item)
  • likert: Multiple items on same scale
  • scale: Continuous numeric rating
  • matrix: Complex evaluation (rows × columns)

Usage Notes

Important Notes

1. Required Properties

The #type property is required for all question types:

### Question
 
#type short_text # Required

v2 Note: The content of ### heading is stored in the label field (in v1 it was in description). When accessing types, use element.label.

2. Property Order

There is no restriction on property order, but it’s recommended to write #type first:

### Question
 
#type short_text
#required true
#placeholder "Enter text"

3. Unsupported Properties

Some properties are not supported by certain question types. Unsupported properties are ignored.

Next Steps

After understanding question types, check the following pages for more details: