gitana / alpaca

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.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Using "number" type with "ListField" based controls returns "null" #626

Open johnwilson opened 6 years ago

johnwilson commented 6 years ago

Alpaca v1.5.24:

When using a ListField based control that has a number type schema with numbers in the enum attribute, the form.getValue() method returns null. Below is the code used:

$("#field1").alpaca({
    "options": {
        "label": "Select a number",
        "helper": "Guess my age?",
        "form": {
            "buttons": {
                "view": {
                    "label": "View JSON",
                    "click": function() {
                        alert(JSON.stringify(this.getValue(), null, "  "));
                    }
                }
            }
        }
    },
    "schema": {
        "enum": [25,11,32],
        "type": "number"
    }
});
seseso commented 6 years ago

I've the same problem. This didn't happen in previous version (1.5.23)