Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
I am using the latest version of Alpaca i.e. 1.5.27.
I have also tested this issue on the Alpaca website and it's occurring there also.
http://www.alpacajs.org/docs/api/forms.html
When I am using the data type as "Boolean" for radio button field, it's not working at all.
Below is the schema (properties) :
"UseSsl": {
"title": "UseSsl",
"type": "boolean",
"enum": [true, false]
}
Options (fields) :
"UseSsl": {
helper: "Flag determining whether to use an SSL connection or not.",
type: "radio",
hideNone: true,
rightLabel: true
}
I have given complete json below which I tested. If I select any option (true or false), it always shows false. But if I change the data type to "string" and make necessary changes, it starts working.
Note: Boolean data type for radio button works in Alpaca version 1.5.23.
I am using the latest version of Alpaca i.e. 1.5.27. I have also tested this issue on the Alpaca website and it's occurring there also. http://www.alpacajs.org/docs/api/forms.html
When I am using the data type as "Boolean" for radio button field, it's not working at all. Below is the schema (properties) : "UseSsl": { "title": "UseSsl", "type": "boolean", "enum": [true, false] }
Options (fields) : "UseSsl": { helper: "Flag determining whether to use an SSL connection or not.", type: "radio", hideNone: true, rightLabel: true }
I have given complete json below which I tested. If I select any option (true or false), it always shows false. But if I change the data type to "string" and make necessary changes, it starts working. Note: Boolean data type for radio button works in Alpaca version 1.5.23.
$("#field1").alpaca({ "schema": { "title": "Your Information", "type": "object", "properties": { "firstName": { "title": "First Name", "type": "string" }, "lastName": { "title": "Last Name", "type": "string" }, "age": { "title": "Age", "type": "integer", "minimum": 0, "maximum": 100 }, "UseSsl": { "title": "UseSsl", "type": "boolean", "enum": [true, false] } } }, "data": {"UseSsl": false}, "options": { "fields": { "UseSsl": { helper: "Flag determining whether to use an SSL connection or not.", type: "radio", hideNone: true, rightLabel: true } }, "form": { "buttons": { "submit": { "click": function() { var value = this.getValue(); alert(JSON.stringify(value, null, " ")); } } } } } });