Generating DOM events from JavaScript

For the OnTime Group Calendar API Explorer I needed manipulate a dropdown element on the page using JavaScript which is easy enough but when doing it this way no onchange events are emitted which caused my page logic to break. Luckily for me there is a simple way to have the element emit an event using the dispatchEvent mechanism of the DOM. The element.dispatchEvent method is your friend here. The documentation shows you how to create a mouse event but I really needed a HTML based event. To create a such is done like below:

// get element
var elem = document.getElementById("some_dropdown");

// set selected option
elem.selectedIndex = 2;

// generate an 'onchange' event from 'elem'
var event = document.createEvent("HTMLEvents");
event.initEvent("change", true, true);
event.eventName = "change";
elem.dispatchEvent(event);

New IBM Connections Kick-Start offering

IntraVision is happy to offer a fixed price IBM Connections Kick-Start offering to get you started with IBM Connections per the entitlement offered by IBM as part of the Notes 8.5.3 maintenance release. At our Social Business event on Thursday 27 October (there’s still time to register) we will be happy to discuss this offering as well as our new OnTime for IBM Connections product with you. More information about event may be found as part of our online newsletter (linked below).

IBM Connections Kick-Start and Social Business event with Stuart J. McRae (in Danish).