Field Types

Below is a list of Formstack field types that you can use with the API

Listed below are the available field types. Each field may have attributes and subfields.

Subfields only apply for complex fields such as name and address. They are submitted and returned in array format. Below is an example of that array format in JSON and URL encoded.

{
    "field_12345": {
    "prefix": "Mr",
    "first": "Example"
  }
}
field_12345%5Bprefix%5D=Mr&field_12345%5Bfirst%5D=Example

Short Answer: text

Short Answer fields are used when you need just a few words

Attributes

Attribute

Default Value

Description

size

50

Size of text field

maxlength

0

Max length of text field

placeholder

Placeholder for text field

Long Answer: textarea

Long Answer fields are used when you need more detail

Attributes

Attribute

Default Value

Description

rows

10

Number of rows to show

cols

50

Number of columns show

maxlength

0

Max length of input

placeholder

Placeholder for textarea field

Name: name

Name fields are used when you need a person's name

Subfields

Subfield

prefix

first

middle

initial

last

suffix

Attributes

Attribute

Default Value

Description

size

20

Size of name field

show_prefix

0

Show prefix field

show_middle

0

Show middle name field

show_initial

0

Show middle initial field

show_suffix

0

Show suffix field

Address: address

Address fields let you collect a person's address

Subfields

Subfield

address

address2

city

state

zip

country

Attributes

Attribute

Default Value

Description

size

50

Size of address field

show_country

0

Show country list

format

US

Format for address input

Email Address: email

Email fields validate the input to make sure it's an email address

Attributes

Attribute

Default Value

Description

size

50

Size of email field

maxlength

0

Max length of email field

confirm

Show a "Confirm Email Address" field

placeholder

Placeholder for email field

Phone Number: phone

Phone Number fields validate the input to make sure it's a phone number

Attributes

Attribute

Default Value

Description

size

20

Size of phone field

format

US

Format for phone number input

placeholder

Placeholder for phone field

Credit Card: creditcard

Credit Card fields validate the input to make sure it's a valid credit card number.

Credit Card fields are only available when using SSL and when a payment integration is added to the form or when database encryption is enabled.

Attributes

Attribute

Default Value

Description

size

20

Size of credit card field

accept_visa

1

Accept Visa cards

accept_mastercard

1

Accept Mastercard cards

accept_amex

1

Accept American Express cards

accept_discover

1

Accept Discover cards

accept_dinersclub

0

Accept Diner's Club cards

accept_jcb

0

Accept JCB cards

Date/Time Field: datetime

Date/Time fields let you ask for a specific date or time

Attributes

Attribute

Default Value

Description

date_format

M d, Y

Format for date input

  • m/d/y
  • m/d/YY
  • M d
  • Y
  • F d, Y
  • d/m/YY
  • d M Y
  • d F Y
  • YY-m-d
  • M Y

time_format

h:i A

Format for time input

  • H,i
  • H,i,s
  • h,i A
  • h,i,s A

year_minus

5

Number of previous years to show

year_plus

5

Number of future years to show

File Upload: file

File uploads allow you to ask for a file, such as an document or image

Attributes

Attribute

Default Value

Description

size

30

Size of file upload field

types

jpg,jpeg,gif,png,bmp,tif,psd,pdf
,doc,docx,xls,xlsx,txt,mp3,mp4
,aac,wav,au,wmv,avi,mpg,mpeg
,zip,gz,rar,z,tgz,tar,sitx

File extensions accepted

Number: number

Number fields restrict input to numbers only

Attributes

Attribute

Default Value

Description

size

5

Size of the number field

min_value

Minimum value

max_value

Maximum value

currency

Currency (dollar, euro, pound, yen)

decimals

0

Number of decimal places to show

use_slider

0

Use a slider for number input

placeholder

Placeholder text to show

Select List: select

Select Lists allow the user to choose from a list of options

Attributes

Attribute

Default Value

Description

option_size

1

Number of options to show at one time

Radio Buttons: radio

Radio Buttons allow only a single answer in an option list

Attributes

Attribute

Default Value

Description

option_layout

vertical

Layout of radio buttons (vertical, horizontal)

option_other

0

Show an 'Other' radio button

option_rand

0

Randomize radio button order

option_store

value

What to store for the radio button in the database (value, label, both)

option_show_values

0

Checkbox: checkbox

Checkboxes allow more than one answer in an option list

Attributes

Attribute

Default Value

Description

option_layout

vertical

Layout of checkboxes (vertical, horizontal)

option_other

0

Show an 'Other' checkbox

option_checkall

0

Show a 'Check All' checkbox

option_rand

0

Randomize checkbox order

option_store

value

What to store for the checkbox in the database (value, label, both)

option_show_values

0

Matrix: matrix

A Matrix field allows you to set up a rating scale

Attributes

Attributes

Default Value

Description

rowchoices

Item 1

Item 2

Item 3

Row choices (separated by newlines)

columnchoices

Very Good

Good

Fair

Poor

Very Poor

Column choices (separated by newlines)

one_per_row

1

Only allow one column selection per row

one_per_column

0

Only allow one row selection per column

rowchoices_rand

0

Randomize row choices

Description Area: richtext

Description areas allow you to place formatted text, images, or HTML within your form

Attributes

Attribute

Default Value

Description

text

The description area text

text_editor

wysiwyg

Editing mode (wysiwyg, basic)

Embed Code: embed

Embed fields allow you to enter javascript embed code or html in your form

Attributes

Attribute

Default Value

Description

text

The embed code text

Event/Product Field: product

Event/Product fields allow you to sell things with ease

Subfields

Subfield

unit_price

quantity

total

Attributes

Attribute

Default Value

Description

charge_type

fixed_amount

Type of charge (fixed_amount, no_charge)

currency

dollar

Currency (dollar, euro, pound, yen)

description

Event description

image

Image for the product/event

inventory

The number of available products/event tickets

inventory_mode

unlimited

Inventory mode

unit_price

3.99

The price of the product/event ticket

min_quanitty

1

The minimum quantity available for purchase at one time

max_quantity

10

The maximum quantity available for purchase at one time

soldout_action

message

The action to take when the product/event is sold out (message, hide_field, waitlist)

is_soldout

If the product/event is sold out

Section: section

Sections allow you to separate different fields on your form into different areas/pages

Attributes

Attribute

Default Value

Description

break

0

Section is a page break

heading

Section heading

text

Section text

text_editor

wysiwyg

Editing mode (wysiwyg, basic)

label_position

default

Label Position for fields

num_columns

0

Number of columns in section