DHTML: Add event dispatcher to HTML form field

Sure you can use this function with any DOM object. Not only a form field.

/* event dispatcher */
function installAC(frm, fld) {
a = document.forms[frm].elements[fld];
if (a.addEventListener) {a.addEventListener("keyup", PerformActions, false)} // firefox
else if (a.attachEvent) {a.attachEvent("onpropertychange", PerformActions)} // ie

/* actions to do */
function PerformActions(h) {
// your code here


Popular posts from this blog

Data visualization for Roadmap Microsite (Angular and D3.js)

Conceptual design

Four tools for prototyping: Sketch, Figma, Principle, and FramerX