If the translated value is still a string, and not a number, then the
size refers to the length of the string, not its numeric value.
if _.isString value
value = value.length
unless min <= value <= max
memo.error = (element.attr "data-range-message") or "RANGE ERROR"
return false
return true
dom.onDocument events.field.optional, "[data-optionality=prohibited]", (event, memo) ->
unless utils.isBlank memo.value
memo.error = (@attr "data-prohibited-message") or "PROHIBITED"
return false
return true
dom.onDocument events.field.validate, "input[data-range-min], input[data-range-max], textarea[data-range-min], textarea[data-range-max]", (event, memo) ->
doRangeValidate this, memo.translated, memo
dom.onDocument events.field.validate, "select[data-range-min], select[data-range-max]", (event, memo) ->
doRangeValidate this, (countOptions this), memo
return