JasonBK
JasonBK

Reputation: 539

reset() with dojo ComboBox

I would like to reset a dojo ComboBox after a (separate) combobox onchange event. But when I try to do this manually in JS, I get an error. What am I doing wrong here?

error:

TypeError: dojo.byId("boroughSelect").reset is not a function (Firebug)

HTML:

       <select id="layerSelect" dojotype="dijit.form.ComboBox"autoComplete="true" value="Selecy Layer"
                   forceValidOption="false" class="comboBoxClass" onchange="setFlag(this)" >

                <option>option1</option>
                <option>option2</option>
                <option>option3</option>

       </select>

JS:

function setFlag(selItem)

{
    dojo.byId("boroughSelect").reset();

}

Upvotes: 0

Views: 4811

Answers (1)

phusick
phusick

Reputation: 7352

You need to obtain a reference to dijit instance, not to DOMNode, therefore use dijit.byId() instead of dojo.byId():

dijit.byId("boroughSelect").reset();

For more detail, please see my answer to Dojo can't programmatically concatenate dijits?

Upvotes: 1

Related Questions