diff --git a/application/ajaxwebpage.class.inc.php b/application/ajaxwebpage.class.inc.php index 8be77dbb2..cc3517730 100644 --- a/application/ajaxwebpage.class.inc.php +++ b/application/ajaxwebpage.class.inc.php @@ -203,7 +203,8 @@ EOF $this->s_content = $this->m_oTabs->RenderIntoContent($this->s_content, $this); // Additional UI widgets to be activated inside the ajax fragment - if ($this->sContentType == 'text/html') + // Important: Testing the content type is not enough because some ajax handlers have not correctly positionned the flag (e.g json response corrupted by the script) + if (($this->sContentType == 'text/html') && (preg_match('/class="date-pick"/', $this->s_content) || preg_match('/class="datetime-pick"/', $this->s_content)) ) { $this->add_ready_script( <<