Login Register

trigger

onChange does not get triggered if TextBox has errors

I have a subclass of ValidationTextBox where I override the onChange-function. The problem is that it doesn't get triggered if there is a validation error.

Lets say I have a field that is required and the value of the field is "a". If I change it to "b" and switches focus to another field, onChange gets executed, but if I remove the "b" and switches focus then onChange does not get executed and instead a validation error is displayed.

onChange: function(newValue) {

Programatically trigger keypress event from a dom node?

I've got a textbox which I programatically want to trigger a keypressed event from. The event must be "custom" with certain attributes set (shiftKey).

I've got this to work successfully in FF, but in IE it refuses to take in my custom event. Here's my IE code:

// create custom event
var newEvent = document.createEventObject();
newEvent.shiftKey = true;
newEvent.type = "keypress";
newEvent.charCode = dojo.keys.ENTER;

// fire event from dom node
var domNode = dojo.byId("somenode");
domNode.fireEvent("onkeypress", newEvent); // this line don't work :(, event never gets fired

Syndicate content