Skip to content

Fields syntax & examples

marrouchi edited this page Feb 29, 2016 · 4 revisions

In this page we will try to give you a detailled reference about how to define form fields.

Select

Properties

  • choices : options for the select as {value1:text1,value2:text2,...}
  • value : default value for the selected option Example : form.fields.number({ widget: gForm.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 })
Clone this wiki locally