In a CF8 form, I'm using a tag such as the following:
<cfinput
type = "Text"
name = "Num"
value = "0"
validate = "range,integer"
range = "0,1000"
validateAt="onBlur,onSubmit"
required = "yes"
message = "Invalid Value"
>
When the field loses focus (onBlur), the input is validated for only the first of the conditions in the validate parameter (it changes when I swap the order).
This is the html / JS code that is auto generated:
<input
name="Num"
id="Num"
type="text"
value="0"
onblur="if( !_CF_hasValue(this, 'TEXT', false)
&&
!_CF_checkrange(this.value,0.0,1000.0, true)
||
!_CF_checkinteger(this.value, true) )
{ _CF_onErrorAlert(new Array('Invalid Value')); }"
/>
OnSubmit is handled with separate autogenerated JS and works properly.
Am I doing something wrong? Does CF8 not support validating these two conditions together?