{"_id":"54357a175e1b2020004380dc","parentDoc":null,"project":"543469460ef9c00800164f0e","user":"543469060ef9c00800164f01","is_link":false,"__v":6,"category":{"_id":"5434918d0ef9c008001651ff","pages":["5435626c5ff8a51a006e4110","543553953513400800a14736","543555cc3513400800a14752","54355bcc35740020002a1b3b","5434928b0ef9c0080016520e","54347c8e5b10711400c6c30a","54346f750ef9c00800164fa0","543470f45b10711400c6c1e5","543477b70ef9c0080016505b","543478fb5b10711400c6c29f","54347d105b10711400c6c318","54347df00ef9c008001650d2","54347edf5b10711400c6c336","54357a175e1b2020004380dc","543483520ef9c0080016512a","543484820ef9c0080016513a","5434887e5b10711400c6c3cd","543488c05b10711400c6c3d2","54348ac85b10711400c6c401","5434959c0ef9c0080016522d","543497030ef9c00800165244","543498ae5b10711400c6c4f6","54349b7f0ef9c00800165293","54349c070ef9c00800165298","54349dbf0ef9c008001652ad","5434ab8e0ef9c00800165384","5434abbb0ef9c0080016538f","5434ac495b10711400c6c626","5434ada40ef9c008001653a8","5434af0a0ef9c008001653bc","5434af5f0ef9c008001653c8","5434b00a5b10711400c6c66b","5434b0d15b10711400c6c68c","5434b1ee0ef9c00800165406","5434b26d0ef9c0080016541c","5434b3560ef9c00800165427","5434b3b40ef9c0080016545a","5434b49f008ec22200d86ab9","5434b51f008ec22200d86aca","5434b5a80ef9c0080016546f","5434b5f4008ec22200d86ad8","5434b676008ec22200d86add","5434b6e6008ec22200d86ae5"],"version":"54346a2a0ef9c00800164f28","__v":30,"project":"543469460ef9c00800164f0e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-08T01:21:17.804Z","from_sync":false,"order":1,"slug":"rest-api","title":"REST API"},"version":{"_id":"54346a2a0ef9c00800164f28","forked_from":"543469460ef9c00800164f11","project":"543469460ef9c00800164f0e","__v":7,"createdAt":"2014-10-07T22:33:14.982Z","releaseDate":"2014-10-07T22:33:14.982Z","categories":["54346a2b0ef9c00800164f29","543473445b10711400c6c21a","543473500ef9c00800164fde","54347c625b10711400c6c301","5434918d0ef9c008001651ff","5434b72c008ec22200d86ae7","5435990c495d5d0800f3a510"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-08T17:53:27.088Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"try":true,"basic_auth":false,"auth":"never","params":[],"url":""},"isReference":false,"order":13,"body":"Listed below are the available field types. Each field may have attributes and subfields. \n\nSubfields 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.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"field_12345\\\": {\\n  \\t\\\"prefix\\\": \\\"Mr\\\",\\n    \\\"first\\\": \\\"Example\\\"\\n  }\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"field_12345%5Bprefix%5D=Mr&field_12345%5Bfirst%5D=Example\",\n      \"language\": \"text\",\n      \"name\": \"URL Encoded\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Short Answer: text\"\n}\n[/block]\nShort Answer fields are used when you need just a few words\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"0-0\": \"size\",\n    \"0-1\": \"50\",\n    \"1-0\": \"maxlength\",\n    \"1-1\": \"0\",\n    \"2-0\": \"placeholder\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of text field\",\n    \"1-2\": \"Max length of text field\",\n    \"2-2\": \"Placeholder for text field\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Long Answer: textarea\"\n}\n[/block]\nLong Answer fields are used when you need more detail\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"rows\",\n    \"0-1\": \"10\",\n    \"1-0\": \"cols\",\n    \"1-1\": \"50\",\n    \"2-0\": \"maxlength\",\n    \"2-1\": \"0\",\n    \"3-0\": \"placeholder\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Number of rows to show\",\n    \"1-2\": \"Number of columns show\",\n    \"2-2\": \"Max length of input\",\n    \"3-2\": \"Placeholder for textarea field\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Name: name\"\n}\n[/block]\nName fields are used when you need a person's name\n\n##Subfields\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Subfield\",\n    \"0-0\": \"prefix\",\n    \"1-0\": \"first\",\n    \"2-0\": \"middle\",\n    \"3-0\": \"initial\",\n    \"4-0\": \"last\",\n    \"5-0\": \"suffix\"\n  },\n  \"cols\": 1,\n  \"rows\": 6\n}\n[/block]\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"0-0\": \"size\",\n    \"0-1\": \"20\",\n    \"1-0\": \"show_prefix\",\n    \"1-1\": \"0\",\n    \"2-0\": \"show_middle\",\n    \"2-1\": \"0\",\n    \"3-0\": \"show_initial\",\n    \"3-1\": \"0\",\n    \"4-0\": \"show_suffix\",\n    \"4-1\": \"0\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of name field\",\n    \"1-2\": \"Show prefix field\",\n    \"2-2\": \"Show middle name field\",\n    \"3-2\": \"Show middle initial field\",\n    \"4-2\": \"Show suffix field\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Address: address\"\n}\n[/block]\nAddress fields let you collect a person's address\n\n##Subfields\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Subfield\",\n    \"0-0\": \"address\",\n    \"1-0\": \"address2\",\n    \"2-0\": \"city\",\n    \"3-0\": \"state\",\n    \"4-0\": \"zip\",\n    \"5-0\": \"country\"\n  },\n  \"cols\": 1,\n  \"rows\": 6\n}\n[/block]\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"0-0\": \"size\",\n    \"0-1\": \"50\",\n    \"1-0\": \"show_country\",\n    \"1-1\": \"0\",\n    \"2-0\": \"format\",\n    \"2-1\": \"US\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of address field\",\n    \"1-2\": \"Show country list\",\n    \"2-2\": \"Format for address input\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Email Address: email\"\n}\n[/block]\nEmail fields validate the input to make sure it's an email address\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"0-0\": \"size\",\n    \"0-1\": \"50\",\n    \"3-0\": \"placeholder\",\n    \"1-0\": \"maxlength\",\n    \"1-1\": \"0\",\n    \"2-0\": \"confirm\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of email field\",\n    \"1-2\": \"Max length of email field\",\n    \"2-2\": \"Show a \\\"Confirm Email Address\\\" field\",\n    \"3-2\": \"Placeholder for email field\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Phone Number: phone\"\n}\n[/block]\nPhone Number fields validate the input to make sure it's a phone number\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"2-0\": \"placeholder\",\n    \"1-0\": \"format\",\n    \"1-1\": \"US\",\n    \"0-0\": \"size\",\n    \"0-1\": \"20\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of phone field\",\n    \"1-2\": \"Format for phone number input\",\n    \"2-2\": \"Placeholder for phone field\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Credit Card: creditcard\"\n}\n[/block]\nCredit Card fields validate the input to make sure it's a valid credit card number.\n\nCredit Card fields are only available when using SSL and when a payment integration is added to the form or when database encryption is enabled.\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"size\",\n    \"0-1\": \"20\",\n    \"1-0\": \"accept_visa\",\n    \"1-1\": \"1\",\n    \"2-0\": \"accept_mastercard\",\n    \"2-1\": \"1\",\n    \"3-0\": \"accept_amex\",\n    \"3-1\": \"1\",\n    \"4-0\": \"accept_discover\",\n    \"4-1\": \"1\",\n    \"5-0\": \"accept_dinersclub\",\n    \"5-1\": \"0\",\n    \"6-0\": \"accept_jcb\",\n    \"6-1\": \"0\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of credit card field\",\n    \"1-2\": \"Accept Visa cards\",\n    \"2-2\": \"Accept Mastercard cards\",\n    \"3-2\": \"Accept American Express cards\",\n    \"4-2\": \"Accept Discover cards\",\n    \"5-2\": \"Accept Diner's Club cards\",\n    \"6-2\": \"Accept JCB cards\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Date/Time Field: datetime\"\n}\n[/block]\nDate/Time fields let you ask for a specific date or time\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"0-1\": \"M d, Y\",\n    \"1-0\": \"time_format\",\n    \"1-1\": \"h:i A\",\n    \"2-0\": \"year_minus\",\n    \"2-1\": \"5\",\n    \"3-0\": \"year_plus\",\n    \"3-1\": \"5\",\n    \"0-0\": \"date_format\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Format for date input\\n- m/d/y\\n- m/d/YY\\n- M d\\n- Y\\n- F d, Y\\n- d/m/YY\\n- d M Y\\n- d F Y\\n- YY-m-d\\n- M Y\",\n    \"1-2\": \"Format for time input\\n- H,i\\n- H,i,s\\n- h,i A\\n- h,i,s A\",\n    \"2-2\": \"Number of previous years to show\",\n    \"3-2\": \"Number of future years to show\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"File Upload: file\"\n}\n[/block]\nFile uploads allow you to ask for a file, such as an document or image\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"size\",\n    \"0-1\": \"30\",\n    \"1-0\": \"types\",\n    \"1-1\": \"jpg,jpeg,gif,png,bmp,tif,psd,pdf\\n,doc,docx,xls,xlsx,txt,mp3,mp4\\n,aac,wav,au,wmv,avi,mpg,mpeg\\n,zip,gz,rar,z,tgz,tar,sitx\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of file upload field\",\n    \"1-2\": \"File extensions accepted\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Number: number\"\n}\n[/block]\nNumber fields restrict input to numbers only\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"size\",\n    \"0-1\": \"5\",\n    \"1-0\": \"min_value\",\n    \"2-0\": \"max_value\",\n    \"3-0\": \"currency\",\n    \"4-0\": \"decimals\",\n    \"4-1\": \"0\",\n    \"5-0\": \"use_slider\",\n    \"5-1\": \"0\",\n    \"6-0\": \"placeholder\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Size of the number field\",\n    \"1-2\": \"Minimum value\",\n    \"2-2\": \"Maximum value\",\n    \"3-2\": \"Currency (dollar, euro, pound, yen)\",\n    \"4-2\": \"Number of decimal places to show\",\n    \"5-2\": \"Use a slider for number input\",\n    \"6-2\": \"Placeholder text to show\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Select List: select\"\n}\n[/block]\nSelect Lists allow the user to choose from a list of options\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"0-0\": \"option_size\",\n    \"0-1\": \"1\",\n    \"1-0\": \"\",\n    \"1-1\": \"\",\n    \"2-0\": \"\",\n    \"2-1\": \"\",\n    \"3-0\": \"\",\n    \"3-1\": \"\",\n    \"4-0\": \"\",\n    \"4-1\": \"\",\n    \"5-0\": \"\",\n    \"5-1\": \"\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Number of options to show at one time\",\n    \"1-2\": \"\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Radio Buttons: radio\"\n}\n[/block]\nRadio Buttons allow only a single answer in an option list\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"option_layout\",\n    \"0-1\": \"vertical\",\n    \"1-0\": \"option_other\",\n    \"1-1\": \"0\",\n    \"2-0\": \"option_rand\",\n    \"2-1\": \"0\",\n    \"3-0\": \"option_store\",\n    \"3-1\": \"value\",\n    \"4-0\": \"option_show_values\",\n    \"4-1\": \"0\",\n    \"0-2\": \"Layout of radio buttons (vertical, horizontal)\",\n    \"1-2\": \"Show an 'Other' radio button\",\n    \"2-2\": \"Randomize radio button order\",\n    \"3-2\": \"What to store for the radio button in the database (value, label, both)\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Checkbox: checkbox\"\n}\n[/block]\nCheckboxes allow more than one answer in an option list\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"option_layout\",\n    \"0-1\": \"vertical\",\n    \"1-0\": \"option_other\",\n    \"1-1\": \"0\",\n    \"2-0\": \"option_checkall\",\n    \"2-1\": \"0\",\n    \"3-0\": \"option_rand\",\n    \"3-1\": \"0\",\n    \"4-0\": \"option_store\",\n    \"4-1\": \"value\",\n    \"5-0\": \"option_show_values\",\n    \"5-1\": \"0\",\n    \"0-2\": \"Layout of checkboxes (vertical, horizontal)\",\n    \"1-2\": \"Show an 'Other' checkbox\",\n    \"2-2\": \"Show a 'Check All' checkbox\",\n    \"3-2\": \"Randomize checkbox order\",\n    \"4-2\": \"What to store for the checkbox in the database (value, label, both)\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Matrix: matrix\"\n}\n[/block]\nA Matrix field allows you to set up a rating scale\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attributes\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"rowchoices\",\n    \"0-1\": \"Item 1\\n\\nItem 2\\n\\nItem 3\",\n    \"1-0\": \"columnchoices\",\n    \"1-1\": \"Very Good\\n\\nGood\\n\\nFair\\n\\nPoor\\n\\nVery Poor\",\n    \"2-0\": \"one_per_row\",\n    \"2-1\": \"1\",\n    \"3-0\": \"one_per_column\",\n    \"3-1\": \"0\",\n    \"4-0\": \"rowchoices_rand\",\n    \"4-1\": \"0\",\n    \"0-2\": \"Row choices (separated by newlines)\",\n    \"1-2\": \"Column choices (separated by newlines)\",\n    \"2-2\": \"Only allow one column selection per row\",\n    \"3-2\": \"Only allow one row selection per column\",\n    \"4-2\": \"Randomize row choices\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Description Area: richtext\"\n}\n[/block]\nDescription areas allow you to place formatted text, images, or HTML within your form\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"text\",\n    \"1-0\": \"text_editor\",\n    \"1-1\": \"wysiwyg\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"The description area text\",\n    \"1-2\": \"Editing mode (wysiwyg, basic)\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Embed Code: embed\"\n}\n[/block]\nEmbed fields allow you to enter javascript embed code or html in your form\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"text\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"The embed code text\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Event/Product Field: product\"\n}\n[/block]\nEvent/Product fields allow you to sell things with ease\n\n##Subfields\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"unit_price\",\n    \"1-0\": \"quantity\",\n    \"2-0\": \"total\",\n    \"h-0\": \"Subfield\"\n  },\n  \"cols\": 1,\n  \"rows\": 3\n}\n[/block]\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"charge_type\",\n    \"0-1\": \"fixed_amount\",\n    \"1-0\": \"currency\",\n    \"1-1\": \"dollar\",\n    \"2-0\": \"description\",\n    \"2-1\": \"\",\n    \"3-0\": \"image\",\n    \"4-0\": \"inventory\",\n    \"5-0\": \"inventory_mode\",\n    \"5-1\": \"unlimited\",\n    \"6-0\": \"unit_price\",\n    \"6-1\": \"3.99\",\n    \"7-0\": \"min_quanitty\",\n    \"7-1\": \"1\",\n    \"8-0\": \"max_quantity\",\n    \"8-1\": \"10\",\n    \"9-0\": \"soldout_action\",\n    \"9-1\": \"message\",\n    \"10-0\": \"is_soldout\",\n    \"10-1\": \"\",\n    \"0-2\": \"Type of charge (fixed_amount, no_charge)\",\n    \"1-2\": \"Currency (dollar, euro, pound, yen)\",\n    \"2-2\": \"Event description\",\n    \"3-2\": \"Image for the product/event\",\n    \"5-2\": \"Inventory mode\",\n    \"4-2\": \"The number of available products/event tickets\",\n    \"6-2\": \"The price of the product/event ticket\",\n    \"7-2\": \"The minimum quantity available for purchase at one time\",\n    \"8-2\": \"The maximum quantity available for purchase at one time\",\n    \"9-2\": \"The action to take when the product/event is sold out (message, hide_field, waitlist)\",\n    \"10-2\": \"If the product/event is sold out\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Section: section\"\n}\n[/block]\nSections allow you to separate different fields on your form into different areas/pages\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Default Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"break\",\n    \"0-1\": \"0\",\n    \"1-0\": \"heading\",\n    \"2-0\": \"text\",\n    \"3-0\": \"text_editor\",\n    \"3-1\": \"wysiwyg\",\n    \"4-0\": \"label_position\",\n    \"4-1\": \"default\",\n    \"5-0\": \"num_columns\",\n    \"5-1\": \"0\",\n    \"5-2\": \"Number of columns in section\",\n    \"4-2\": \"Label Position for fields\",\n    \"3-2\": \"Editing mode (wysiwyg, basic)\",\n    \"2-2\": \"Section text\",\n    \"1-2\": \"Section heading\",\n    \"0-2\": \"Section is a page break\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]","excerpt":"Below is a list of Formstack field types that you can use with the API","slug":"field-types","type":"basic","title":"Field Types"}

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. [block:code] { "codes": [ { "code": "{\n\t\"field_12345\": {\n \t\"prefix\": \"Mr\",\n \"first\": \"Example\"\n }\n}", "language": "json" }, { "code": "field_12345%5Bprefix%5D=Mr&field_12345%5Bfirst%5D=Example", "language": "text", "name": "URL Encoded" } ] } [/block] [block:api-header] { "type": "basic", "title": "Short Answer: text" } [/block] Short Answer fields are used when you need just a few words ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "0-0": "size", "0-1": "50", "1-0": "maxlength", "1-1": "0", "2-0": "placeholder", "h-2": "Description", "0-2": "Size of text field", "1-2": "Max length of text field", "2-2": "Placeholder for text field" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Long Answer: textarea" } [/block] Long Answer fields are used when you need more detail ##Attributes [block:parameters] { "data": { "0-0": "rows", "0-1": "10", "1-0": "cols", "1-1": "50", "2-0": "maxlength", "2-1": "0", "3-0": "placeholder", "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-2": "Number of rows to show", "1-2": "Number of columns show", "2-2": "Max length of input", "3-2": "Placeholder for textarea field" }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Name: name" } [/block] Name fields are used when you need a person's name ##Subfields [block:parameters] { "data": { "h-0": "Subfield", "0-0": "prefix", "1-0": "first", "2-0": "middle", "3-0": "initial", "4-0": "last", "5-0": "suffix" }, "cols": 1, "rows": 6 } [/block] ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "0-0": "size", "0-1": "20", "1-0": "show_prefix", "1-1": "0", "2-0": "show_middle", "2-1": "0", "3-0": "show_initial", "3-1": "0", "4-0": "show_suffix", "4-1": "0", "h-2": "Description", "0-2": "Size of name field", "1-2": "Show prefix field", "2-2": "Show middle name field", "3-2": "Show middle initial field", "4-2": "Show suffix field" }, "cols": 3, "rows": 5 } [/block] [block:api-header] { "type": "basic", "title": "Address: address" } [/block] Address fields let you collect a person's address ##Subfields [block:parameters] { "data": { "h-0": "Subfield", "0-0": "address", "1-0": "address2", "2-0": "city", "3-0": "state", "4-0": "zip", "5-0": "country" }, "cols": 1, "rows": 6 } [/block] ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "0-0": "size", "0-1": "50", "1-0": "show_country", "1-1": "0", "2-0": "format", "2-1": "US", "h-2": "Description", "0-2": "Size of address field", "1-2": "Show country list", "2-2": "Format for address input" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Email Address: email" } [/block] Email fields validate the input to make sure it's an email address ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "0-0": "size", "0-1": "50", "3-0": "placeholder", "1-0": "maxlength", "1-1": "0", "2-0": "confirm", "h-2": "Description", "0-2": "Size of email field", "1-2": "Max length of email field", "2-2": "Show a \"Confirm Email Address\" field", "3-2": "Placeholder for email field" }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Phone Number: phone" } [/block] Phone Number fields validate the input to make sure it's a phone number ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "2-0": "placeholder", "1-0": "format", "1-1": "US", "0-0": "size", "0-1": "20", "h-2": "Description", "0-2": "Size of phone field", "1-2": "Format for phone number input", "2-2": "Placeholder for phone field" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Credit Card: creditcard" } [/block] 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 [block:parameters] { "data": { "0-0": "size", "0-1": "20", "1-0": "accept_visa", "1-1": "1", "2-0": "accept_mastercard", "2-1": "1", "3-0": "accept_amex", "3-1": "1", "4-0": "accept_discover", "4-1": "1", "5-0": "accept_dinersclub", "5-1": "0", "6-0": "accept_jcb", "6-1": "0", "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-2": "Size of credit card field", "1-2": "Accept Visa cards", "2-2": "Accept Mastercard cards", "3-2": "Accept American Express cards", "4-2": "Accept Discover cards", "5-2": "Accept Diner's Club cards", "6-2": "Accept JCB cards" }, "cols": 3, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Date/Time Field: datetime" } [/block] Date/Time fields let you ask for a specific date or time ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "0-1": "M d, Y", "1-0": "time_format", "1-1": "h:i A", "2-0": "year_minus", "2-1": "5", "3-0": "year_plus", "3-1": "5", "0-0": "date_format", "h-2": "Description", "0-2": "Format for date input\n- m/d/y\n- m/d/YY\n- M d\n- Y\n- F d, Y\n- d/m/YY\n- d M Y\n- d F Y\n- YY-m-d\n- M Y", "1-2": "Format for time input\n- H,i\n- H,i,s\n- h,i A\n- h,i,s A", "2-2": "Number of previous years to show", "3-2": "Number of future years to show" }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "File Upload: file" } [/block] File uploads allow you to ask for a file, such as an document or image ##Attributes [block:parameters] { "data": { "0-0": "size", "0-1": "30", "1-0": "types", "1-1": "jpg,jpeg,gif,png,bmp,tif,psd,pdf\n,doc,docx,xls,xlsx,txt,mp3,mp4\n,aac,wav,au,wmv,avi,mpg,mpeg\n,zip,gz,rar,z,tgz,tar,sitx", "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-2": "Size of file upload field", "1-2": "File extensions accepted" }, "cols": 3, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Number: number" } [/block] Number fields restrict input to numbers only ##Attributes [block:parameters] { "data": { "0-0": "size", "0-1": "5", "1-0": "min_value", "2-0": "max_value", "3-0": "currency", "4-0": "decimals", "4-1": "0", "5-0": "use_slider", "5-1": "0", "6-0": "placeholder", "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-2": "Size of the number field", "1-2": "Minimum value", "2-2": "Maximum value", "3-2": "Currency (dollar, euro, pound, yen)", "4-2": "Number of decimal places to show", "5-2": "Use a slider for number input", "6-2": "Placeholder text to show" }, "cols": 3, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Select List: select" } [/block] Select Lists allow the user to choose from a list of options ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "0-0": "option_size", "0-1": "1", "1-0": "", "1-1": "", "2-0": "", "2-1": "", "3-0": "", "3-1": "", "4-0": "", "4-1": "", "5-0": "", "5-1": "", "h-2": "Description", "0-2": "Number of options to show at one time", "1-2": "" }, "cols": 3, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Radio Buttons: radio" } [/block] Radio Buttons allow only a single answer in an option list ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-0": "option_layout", "0-1": "vertical", "1-0": "option_other", "1-1": "0", "2-0": "option_rand", "2-1": "0", "3-0": "option_store", "3-1": "value", "4-0": "option_show_values", "4-1": "0", "0-2": "Layout of radio buttons (vertical, horizontal)", "1-2": "Show an 'Other' radio button", "2-2": "Randomize radio button order", "3-2": "What to store for the radio button in the database (value, label, both)" }, "cols": 3, "rows": 5 } [/block] [block:api-header] { "type": "basic", "title": "Checkbox: checkbox" } [/block] Checkboxes allow more than one answer in an option list ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-0": "option_layout", "0-1": "vertical", "1-0": "option_other", "1-1": "0", "2-0": "option_checkall", "2-1": "0", "3-0": "option_rand", "3-1": "0", "4-0": "option_store", "4-1": "value", "5-0": "option_show_values", "5-1": "0", "0-2": "Layout of checkboxes (vertical, horizontal)", "1-2": "Show an 'Other' checkbox", "2-2": "Show a 'Check All' checkbox", "3-2": "Randomize checkbox order", "4-2": "What to store for the checkbox in the database (value, label, both)" }, "cols": 3, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Matrix: matrix" } [/block] A Matrix field allows you to set up a rating scale ##Attributes [block:parameters] { "data": { "h-0": "Attributes", "h-1": "Default Value", "h-2": "Description", "0-0": "rowchoices", "0-1": "Item 1\n\nItem 2\n\nItem 3", "1-0": "columnchoices", "1-1": "Very Good\n\nGood\n\nFair\n\nPoor\n\nVery Poor", "2-0": "one_per_row", "2-1": "1", "3-0": "one_per_column", "3-1": "0", "4-0": "rowchoices_rand", "4-1": "0", "0-2": "Row choices (separated by newlines)", "1-2": "Column choices (separated by newlines)", "2-2": "Only allow one column selection per row", "3-2": "Only allow one row selection per column", "4-2": "Randomize row choices" }, "cols": 3, "rows": 5 } [/block] [block:api-header] { "type": "basic", "title": "Description Area: richtext" } [/block] Description areas allow you to place formatted text, images, or HTML within your form ##Attributes [block:parameters] { "data": { "0-0": "text", "1-0": "text_editor", "1-1": "wysiwyg", "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-2": "The description area text", "1-2": "Editing mode (wysiwyg, basic)" }, "cols": 3, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Embed Code: embed" } [/block] Embed fields allow you to enter javascript embed code or html in your form ##Attributes [block:parameters] { "data": { "0-0": "text", "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-2": "The embed code text" }, "cols": 3, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Event/Product Field: product" } [/block] Event/Product fields allow you to sell things with ease ##Subfields [block:parameters] { "data": { "0-0": "unit_price", "1-0": "quantity", "2-0": "total", "h-0": "Subfield" }, "cols": 1, "rows": 3 } [/block] ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-0": "charge_type", "0-1": "fixed_amount", "1-0": "currency", "1-1": "dollar", "2-0": "description", "2-1": "", "3-0": "image", "4-0": "inventory", "5-0": "inventory_mode", "5-1": "unlimited", "6-0": "unit_price", "6-1": "3.99", "7-0": "min_quanitty", "7-1": "1", "8-0": "max_quantity", "8-1": "10", "9-0": "soldout_action", "9-1": "message", "10-0": "is_soldout", "10-1": "", "0-2": "Type of charge (fixed_amount, no_charge)", "1-2": "Currency (dollar, euro, pound, yen)", "2-2": "Event description", "3-2": "Image for the product/event", "5-2": "Inventory mode", "4-2": "The number of available products/event tickets", "6-2": "The price of the product/event ticket", "7-2": "The minimum quantity available for purchase at one time", "8-2": "The maximum quantity available for purchase at one time", "9-2": "The action to take when the product/event is sold out (message, hide_field, waitlist)", "10-2": "If the product/event is sold out" }, "cols": 3, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Section: section" } [/block] Sections allow you to separate different fields on your form into different areas/pages ##Attributes [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Default Value", "h-2": "Description", "0-0": "break", "0-1": "0", "1-0": "heading", "2-0": "text", "3-0": "text_editor", "3-1": "wysiwyg", "4-0": "label_position", "4-1": "default", "5-0": "num_columns", "5-1": "0", "5-2": "Number of columns in section", "4-2": "Label Position for fields", "3-2": "Editing mode (wysiwyg, basic)", "2-2": "Section text", "1-2": "Section heading", "0-2": "Section is a page break" }, "cols": 3, "rows": 6 } [/block]