var t = 'This is the Template:<center><form><table border="1" width="180"><tr><td align="center">Select a Date of Birth:<br>{@dpDOB}</td></tr></table></form></center>'; var tp = new Template(t,100,100,250,200,'#EEEEEE'); tp.addChild(new HTMLDatePicker(null),'dpDOB'); tp.dpDOB.addEventListener({ onchange:function(e){ var o=e.getSource(); status = o.getDate(); } });