When parseInputAttributes: true and the observable is not validatable the input does not get a validation message inserted, nor the validation class validationElement.
The problem is in the validationCore binding as it asynchronously executes parseInputValidationAttributes. The later method will make the observable validatable if it matches some criteria (eg. input type is number/email, has a required attribute etc.)
Solutions:
- execute
parseInputValidationAttributes synchronously - this adds some overhead when bindings are applied.
- duplicate code in the
validationCore binding to ensure config.insertMessages and config.decorateInputElement are applied if the observable becomes validatable.
I've created a fiddle for this - it has both the solutions and some intructions on how to fix it. The interesting code starts at line 1016 in the JavaScript panel of JSFiddle.
http://jsfiddle.net/3594jm1o/
Any thoughts?
When
parseInputAttributes: trueand the observable is not validatable theinputdoes not get a validation message inserted, nor the validation classvalidationElement.The problem is in the
validationCorebinding as it asynchronously executesparseInputValidationAttributes. The later method will make the observable validatable if it matches some criteria (eg. input type is number/email, has a required attribute etc.)Solutions:
parseInputValidationAttributessynchronously - this adds some overhead when bindings are applied.validationCorebinding to ensureconfig.insertMessagesandconfig.decorateInputElementare applied if the observable becomes validatable.I've created a fiddle for this - it has both the solutions and some intructions on how to fix it. The interesting code starts at line 1016 in the JavaScript panel of JSFiddle.
http://jsfiddle.net/3594jm1o/
Any thoughts?