/** * Add a plain text error message to a field on this form. It will be saved into the session * and used the next time this form is displayed. * @param string $fieldName * @param string $message * @param string $messageType * @param bool $escapeHtml */ public function addErrorMessage($fieldName, $message, $messageType, $escapeHtml = true) { Session::add_to_array("FormInfo.{$this->FormName()}.errors", array('fieldName' => $fieldName, 'message' => $escapeHtml ? Convert::raw2xml($message) : $message, 'messageType' => $messageType)); }