DateItem and ValidateOnChange

I have a dynamic date field with useTextField: true and validateOnChange: true. However, I can’t seem to get the field to validate.

How can I get the date field to operate like a text field?

PS. I am using beta 7, if that makes any difference.

Is there no way to get the text field of a DateItem to work like a regular text field (validation wise)?

To clarify, you want validation on every keystroke? So as soon as the user begins typing (starting in an empty field), it’s shown as invalid?

Ideally it should filter the input, just like a text item with a numeric validator does for example. But it should at least mark it as invalid if the input does not parse to a valid date once the focus leaves the field.

Is that doable?

Yes - you should already be seeing the input marked as invalid when the user leaves the field, if the field is declared in the DataSource as type “date” and you have validateOnChange:true. If not, can you show a standalone test case demonstrating the problem?

This will allow me to type anything I want in the date field and never show an error. The number field shows an error as soon as I type a non-digit character.

        isc.DynamicForm.create({
            fields: [
                {name: "Renewal Date", type: "date", useTextField: true, validateOnChange: true},
                {name: "Renewal Number", type: "integer", validateOnChange: true},
            ]
        });

Hi Mark
This looks like a bug - we’re investigating this and will be sure to get a fix for the 7.0 final release.
However as a workaround you can set the property enforceDate to true.
This property will give you essentially date-validation when the field is blurred. It’s undocumented in 6.5.1 but should be safe to use, and is exposed as part of the 7.0 / 7.0beta release

Thanks
Isomorphic Software