$('#dd').datebox(...).datebox('options').keyHandler.query = function(){ $(this).datebox('hidePanel');};