AnsweredAssumed Answered

buffer with checkboxes

Question asked by tanguyen88 on Aug 3, 2015
Latest reply on Aug 3, 2015 by rscheitlin
Branched to a new discussion



I'm trying to create 4 checkboxes (values- in miles- are 0.5, 1, 1.5, 2). I want to make it so that the values of checkboxes that are checked get inputted as params.distances (for buffers). I've tried for hours and I can't seem to get the dojo checkbox to show up.

When I included 'dijit/form/CheckBox', I followed the example tutorial. Widget.js had the following:

var distances = [];

        var cboxpt5 = new CheckBox({

            name: "cboxpt5",

            value: "0.5",

            checked: false,

            onclick: function(){distances.push(cboxpt5.value);}

        }, "cboxpt5").startup();

in Widget.html, I had:

<input id="cboxpt5" /><label for="cboxpt5">0.5</label>

I kept getting just a text field when I launched the web app, so I figured that somehow, the checkbox form widget.js was not being conveyed to widget.html.

I looked at a code sample of Robert S. and I noticed he used 'jimu/dijit/CheckBox'. But using that module didn't work either. Any ideas? Thank you!