hides the pop-up task form (if it's currently active)
gantt.showQuickInfo(5); ... gantt.hideQuickInfo();
This method is defined in the quick_info.js extension, so you need to activate the quick_info plugin.