Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 1.13 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to get updated value from Dijit.editor and set it to other div
  2. <div dojoType="dijit.Editor" id="editor"></div>
  3. <div id="target"><div>
  4.        
  5. dojo.addOnLoad(function() {
  6.  
  7.             var geteditor = dojo.byId("editor");
  8.             dojo.connect(geteditor, "onChange", function() {
  9.                var a =  dijit.byId("editor").get("value");
  10.                dojo.byId("target").innerHTML= a ;
  11.  
  12.             });
  13.           });
  14.        
  15. dojo.require("dijit.form.TextBox");
  16.  dojo.require("dojo.parser");
  17.  
  18.  dojo.ready(function(){
  19.      dojo.parser.parse();
  20.      var box0 = dijit.byId("value0Box");
  21.      var box1 = dijit.byId("value1Box");
  22.      box1.set("value", box0.get("value") + " modified");
  23.      dojo.connect(box0, "onChange", function(){
  24.          box1.set("value", box0.get("value") + " modified");
  25.      });
  26.  });
  27.  
  28.  
  29. <label for="value0Box">A textbox with a value:</label>
  30. <input id="value0Box" data-dojo-type="dijit.form.TextBox" value="Some value" data-dojo-props="intermediateChanges:true"></input>
  31. <br>
  32. <label for="value1Box">A textbox set with a value from the above textbox:</label>  
  33. <input id="value1Box" data-dojo-type="dijit.form.TextBox"></input>
  34. <br>