This is a small JQuery library built for interacting with the Signups API, but also generate forms in general.
The form element will be generated for you, so apply it to a wrapper.
$("#formWrapper").signupForm("form.json");
{
"form": {},
"fields": []
}
{
"form": {
"attributes": {
"action": "/",
"autocomplete": "on",
"enctype": "text/plain",
"method": "GET",
"name": "form",
"novalidate": "true"
}
}
}
"fields": [
{
"element": "input",
"label": "Label for input",
"attributes": {
"type": "text",
"value": "Default Value",
"autocomplete": "on",
"min": "1",
"max": "9",
"pattern": "^hey",
"placeholder": "Default placeholder",
"required": "true",
"step": "false",
"class": "default-class",
"name": "defaultName"
},
"grid": {
"size": 50
}
},
{
"element": "select",
"label": "This is a select",
"attributes": {
"class": "defaultSelect"
},
"options": [
{
"value": "One",
"label": "Uno",
"select": "false"
},
{
"value": "Two",
"label": "Dos",
"select": "true"
}
]
},
{
"element": "datepicker",
"label": "Your age",
"attributes": {
"class": "datepicker-class" // Will be applied after the default datepicker class
},
"settings": {
// Datepicker plugin settings
}
}
]