-
Notifications
You must be signed in to change notification settings - Fork 166
Fields syntax & examples
marrouchi edited this page Feb 29, 2016
·
4 revisions
In this page we will try to give you a reference about how to define form fields.
Properties
- choices : options for the select as {value1:text1,value2:text2,...}
- value : default value for the selected option
form.fields.number({
widget: form.widgets.select(),
choices:(function(){ // Display select as a range from -50 to 50
var range = [];
var k=0;
for (var v=-50;v<=50;v++) {
range[k]=v;
k++;
}
console.log(range);
return range;
})(),
value: 50, // Default value
})