This section provides a sample javascript object literal (JSON Object) for each of the different supported field types.
Please review the Form Definition File section to review the entire structure for a form's complete definition. You can copy and paste individual field objects into your own formData.json file and modify the values to meet your needs. Key value pairs in red are optional. Items to be modified are in blue. All others are required.
{
"Label":"Text Field",
"FieldDataID":"textFldID",
"width": 300,
"Type":"text",
"Placeholder": "Enter any text",
"required" : 1
}
Notes:
{
"Label":"Text Area",
"FieldDataID":"TextAreaFldID",
"Type":"textarea",
"width" : 300,
"minheight": 100,
"Placeholder": "Enter your comment here",
"required" : 1
}
Notes:
{
"Label":"CheckBox",
"FieldDataID":"chkboxID",
"Type":"checkbox",
"CbxValues": [
"Option 1",
"Option 2",
"Option 3",
"Option 4"
],
}
Notes:
{
"Label":"Radio Group",
"FieldDataID":"radioGrpID",
"Type":"radio",
"Options": [
"Radio Btn 1",
"Radio Btn 2",
"Radio Btn 3"
],
"Checked":"Radio Btn 2",
"required" : 1
}
Notes:
{
"Label":"Selection List",
"FieldDataID":"SelListFldID",
"Type":"select",
"OptionStart":"Select One",
"Options": [
"Select Option 1",
"Select Option 2",
"Select Option 3"
],
"required" : 1
}
Notes:
{
"Label":"Number Field",
"FieldDataID":"numberFldID",
"width": 75,
"Type":"number",
"max" : 10,
"min" : 1,
"Placeholder": "(1-10)",
"Pattern":"[1-9]|10",
"required" : 1
}
Notes:
{
"Label":"Email Field",
"FieldDataID":"emailFldID",
"width": 250,
"Type":"email",
"Placeholder": "Valid email address",
"required" : 1
}
Notes:
{
"Label":"URL Field",
"FieldDataID":"URLFldID",
"width": 250,
"Type":"url",
"Placeholder": "Begin with http:// or https://",
"Pattern":"https?://.+",
"required" : 1
}
Notes:
{
"Label":"Date",
"FieldDataID":"dateID",
"width":150,
"Type":"date",
"Placeholder": "mm/dd/yyyy",
"Pattern" : "(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\\d\\d",
"required": 1
}
Notes: