0
當您爲文本字段設置最大長度時,微風將發送不正確的驗證消息。我在我的字段上設置了一個可包含100個字符的最大長度。當我超過這個微風返回以下驗證錯誤:BreezeJS maxLength的錯誤消息
'主題'必須是少於100個字符的字符串。
它應該閱讀:
「主體」必須少於101個字符的字符串。
或
'subject'必須是一個不超過100個字符的字符串。
這裏的問題是代碼:
ctor.messageTemplates = {
required: "'%displayName%' is required",
date: "'%displayName%' must be a date",
string: "'%displayName%' must be a string",
bool: "'%displayName%' must be a 'true' or 'false' value",
guid: "'%displayName%' must be a GUID",
duration: "'%displayName%' must be a ISO8601 duration string, such as 'P3H24M60S'",
number: "'%displayName%' must be a number",
integer: "'%displayName%' must be an integer",
integerRange: "'%displayName%' must be an integer between the values of %minValue% and %maxValue%",
maxLength: "'%displayName%' must be a string with less than %maxLength% characters",
stringLength: "'%displayName%' must be a string with between %minLength% and %maxLength% characters"
};