src/Forms/Form.php
public function setFieldMessage(
        $fieldName,
        $message,
        $messageType = ValidationResult::TYPE_ERROR,
        $messageCast = ValidationResult::CAST_TEXT
    ) {
        $field = $this->fields->dataFieldByName($fieldName);
        if ($field) {
            $field->setMessage($message, $messageType, $messageCast);
        }
        return $this;
    }
public function setFieldMessage(
        $fieldName,
        $message,
        $messageType = ValidationResult::TYPE_ERROR,
        $messageCast = ValidationResult::CAST_TEXT
    ) {
        $field = $this->fields->dataFieldByName($fieldName);
        if ($field) {
            $field->setMessage($message, $messageType, $messageCast);
        }
        return $this;
    }
public function setFieldMessage ( $ fieldName , $ message , $ messageType = ValidationResult :: TYPE_ERROR , $ messageCast = ValidationResult :: CAST_TEXT ) { $ field = $ this -> fields -> dataFieldByName ( $ fieldName ) ; if ( $ field ) { $ field -> setMessage ( $ message , $ messageType , $ messageCast ) ; } return $ this ; }
Set message on a given field name. This message will not persist via redirect.

@param string $fieldName
@param string $message
@param string $messageType
@param string $messageCast
@return $this
Set message on a given field name . This message will not persist via redirect .