Skip to content

Instantly share code, notes, and snippets.

@dana-ross
Created October 23, 2014 21:31
Show Gist options
  • Save dana-ross/c47a9de9a345b5de92e9 to your computer and use it in GitHub Desktop.
Save dana-ross/c47a9de9a345b5de92e9 to your computer and use it in GitHub Desktop.
Sample JSON structure for formbuilder plugin
[
{
"label":"Text field label",
"field_type":"text",
"required":true,
"field_options":{
"size":"small",
"description":"Text field description",
"minlength":"1",
"maxlength":"100"
},
"cid":"c2"
},
{
"label":"Checkbox field label",
"field_type":"checkboxes",
"required":true,
"field_options":{
"options":[
{
"label":"Option 1 (checked by default)",
"checked":true
},
{
"label":"Option 2 (not checked by default)",
"checked":false
}
],
"description":"Checkbox field description",
"include_other_option":true
},
"cid":"c6"
},
{
"label":"Date field label",
"field_type":"date",
"required":true,
"field_options":{
"description":"Date field description"
},
"cid":"c10"
},
{
"label":"Time field label",
"field_type":"time",
"required":true,
"field_options":{
"description":"Time field description"
},
"cid":"c14"
},
{
"label":"Website field label",
"field_type":"website",
"required":true,
"field_options":{
"description":"Website field description"
},
"cid":"c18"
},
{
"label":"Price field label",
"field_type":"price",
"required":true,
"field_options":{
"description":"Price field description"
},
"cid":"c22"
},
{
"label":"Paragraph field label",
"field_type":"paragraph",
"required":true,
"field_options":{
"size":"small",
"description":"Paragraph field description",
"minlength":"1",
"maxlength":"100"
},
"cid":"c26"
},
{
"label":"Multiple choice field label",
"field_type":"radio",
"required":true,
"field_options":{
"options":[
{
"label":"Option 1 (selected by default)",
"checked":true
},
{
"label":"Option 2",
"checked":false
}
],
"description":"Multiple choice field description",
"include_other_option":true
},
"cid":"c30"
},
{
"label":"Dropdown field label",
"field_type":"dropdown",
"required":true,
"field_options":{
"options":[
{
"label":"Option 1 (selected by default)",
"checked":true
},
{
"label":"Option 2 (not selected by default)",
"checked":false
}
],
"include_blank_option":true,
"description":"Dropdown field description"
},
"cid":"c34"
},
{
"label":"Number field label",
"field_type":"number",
"required":true,
"field_options":{
"description":"Number field description",
"min":"1",
"max":"100",
"units":"units",
"integer_only":true
},
"cid":"c29"
},
{
"label":"Email field label",
"field_type":"email",
"required":true,
"field_options":{
"description":"Email field description"
},
"cid":"c33"
},
{
"label":"Address field label",
"field_type":"address",
"required":true,
"field_options":{
"description":"Address field description"
},
"cid":"c37"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment