Unable to get Dojo Textbox Value in Handler
In the key up handler when i try to access the value 开发者_如何转开发of the textbox i get an empty string back. this is my code.
dojo.connect(dijit.byId("loginpassword"), "onKeyUp", function(evt){
if(evt.keyCode==13){
var value = dijit.byId("loginpassword"); //get a empty string here
}
});
When i try the same statement outside the handler it works properly. Am I doing something wrong, or is it a dojo bug?
Update: This was wat i had actually had
var value = dijit.byId("loginpassword").value;
dijit.byId("loginpassword") is going to return a widget Object, not a string (check typeof) Perhaps you want to do something like dijit.byId("loginpassword").attr("value") ?
精彩评论