
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 1.13 KB | hits: 8 | expires: Never
How to get updated value from Dijit.editor and set it to other div
<div dojoType="dijit.Editor" id="editor"></div>
<div id="target"><div>
dojo.addOnLoad(function() {
var geteditor = dojo.byId("editor");
dojo.connect(geteditor, "onChange", function() {
var a = dijit.byId("editor").get("value");
dojo.byId("target").innerHTML= a ;
});
});
dojo.require("dijit.form.TextBox");
dojo.require("dojo.parser");
dojo.ready(function(){
dojo.parser.parse();
var box0 = dijit.byId("value0Box");
var box1 = dijit.byId("value1Box");
box1.set("value", box0.get("value") + " modified");
dojo.connect(box0, "onChange", function(){
box1.set("value", box0.get("value") + " modified");
});
});
<label for="value0Box">A textbox with a value:</label>
<input id="value0Box" data-dojo-type="dijit.form.TextBox" value="Some value" data-dojo-props="intermediateChanges:true"></input>
<br>
<label for="value1Box">A textbox set with a value from the above textbox:</label>
<input id="value1Box" data-dojo-type="dijit.form.TextBox"></input>
<br>