title: How to get value of Dojo/Dijit ColorPalette to a string
body: <p>I'm always getting a null color object back.  I haven't touched Dojo in about a year, so everything is very rusty.  The colorPallette displays, but when I click on it, the variable objColor below is always null. </p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;html dir="ltr"&gt;
  
      &lt;head&gt;
          &lt;style type="text/css"&gt;
              body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
          &lt;/style&gt;
          &lt;script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js"
          djConfig="parseOnLoad: true"&gt;
          &lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              dojo.require("dojox.widget.ColorPicker");
              dojo.require("dijit.ColorPalette");
              dojo.require("dijit.form.TextBox");
              dojo.require("dijit.form.Textarea");
              output = "Color=&amp;Color,SoundFile=&amp;SoundFile"; 
              function updateResults()
              {
                 var objColorPalette = dijit.byId("colorPalette"); 
                 var objColor = objColorPalette.value; 
                 //var objColor = objColorPalette.attr("value"); 
                 //alert("objColor=" + objColor);
                 if (objColor == null)
                 {
                    output = output.replace("&amp;Color","null"); 
                 }
                 else
                 {
                    output = output.replace("&amp;Color",objColor.toHex()); 
                 }
                 var objResultTextArea = dijit.byId("results");
                 objResultTextArea.set("value", output); 
              }
              function setColor(val)
              {
                 output = output.replace("&amp;Color",val.toHex()); 
                 var objResultTextArea = dijit.byId("results");
                 objResultTextArea.set("value", output); 
              }
          &lt;/script&gt;
          &lt;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css"
          /&gt;
          &lt;link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojox/widget/ColorPicker/ColorPicker.css"
          /&gt;
      &lt;/head&gt;
  
      &lt;body class=" claro "&gt;
          &lt;h3&gt;Begin Data Entry&lt;/h3&gt;
          &lt;label for="mp3FileName"&gt;
              Auto-trimming, Proper-casing Textbox:
          &lt;/label&gt;        
          &lt;input type="text" name="mp3FileName" value="/yourRelativeFileName.mp3" dojoType="dijit.form.TextBox"
          trim="true" id="firstname" propercase="true"&gt;
  
          &lt;h3&gt;Color&lt;/h3&gt;
          &lt;div dojoType="dijit.ColorPalette" onChange="updateResults()" palette="7x10" id="colorPalette"&gt;
          &lt;/div&gt;
          &lt;!--
          &lt;h3&gt;Color Picker&lt;/h3&gt;
          &lt;div dojoType="dojox.widget.ColorPicker" id="colorPicker"&gt;
          &lt;/div&gt;
          --&gt;
  
          &lt;h3&gt;Results&lt;/h3&gt;
          &lt;textarea id="results" name="results" dojoType="dijit.form.Textarea"
          style="width:900px;"&gt;
              Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
              nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
          &lt;/textarea&gt;        
          &lt;h3&gt;The End&lt;/h3&gt;
  
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>