In CF8 form, I use a tag, for example:
<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 checked only for the first of the conditions in the check parameter (it changes when I change the order).
This is the html / JS code that is generated automatically:
<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 a separate auto-generated JS and works correctly.
Am I doing something wrong? Does CF8 not support checking these two conditions together?
source share