Login Register

Editor - how do I get values

I am new to Dojo and am having trouble with the Editor widget. I can get it to display properly, but am unable to retrieve the text that the user types in. When I submit the form, the server receives a blank string. When I catch the submit event in javascript and examine the Editor's value, it is blank. My code is:

@import "styles/print/printBase.css";
@import "styles/print/printRecipe.css";
@import "dojo-1.1/dojo/resources/dojo.css";
@import "dojo-1.1/dijit/themes/tundra/tundra.css";
h2 {width:auto;text-align:center;}

 

dojo.require("dojo.parser");
                        dojo.require("dijit.Editor");

Certification Note

The javascript to catch the submit event is:

var myAction = {
submit : function() {
var theBox = document.getElementsByTagName('textarea');
alert(theBox[0].value);
}
}

Thank you for any help.

Figured it out!

For any other new guys out there - here's the solution

var theBox = dijit.byId('theText'); //The Edit widget, has to be 'dijit' to work
var theValue = theBox.getValue();