Add --select-- to drop down list

1
I have a couple of drop down lists on a form. How do I add --select-- (or something similar) as the first item of the list?    
asked
1 answers
0

Mark, add an HTMLSnippet widget below your dropdown, and put this JavaScript in there. Note, this code actually removes the blank option, but you could modify the second to last line, and change it to something like:

 

this._editNode.children[0].innerHTML = "--select--";

 

var selector;
selector = dijit.registry.byNode(this.domNode.previousSibling);
if (typeof selector === "undefined") {
       selector = dijit.registry.byNode(this.domNode.previousSibling.children[1]);
}
 
dojo.require("dojo.aspect");
dojo.aspect.after(selector, "_renderOptions", function(deferred){
       this._editNode.removeChild(this._editNode.children[0]);
       return deferred;
});

 

answered