Issue: While typing URL, the red border disappears as soon as URL is properly formatted, but does not get back to when the URL changes back to improperly formatted.
To duplicate the issue type the URL until red border disappears and then change the URL so that it gets improperly formatted.
Expected: the red border should be back.
Happens: the red border does not get back
Test Example: <text+type%3D"url"+label%3D"Width">123<%2Ftext>
This functionality uses native HTML5 controls. So logic of validation is not controlled by the library, but processed by a browser ( I suspect that behavior will differ between browsers )
Unfortunately, Webix validation is overcomplicated.
Specifically: validation cannot be assigned to each field as a property.
Instead, it requires a dedicated function where validation for all the form Fields is aggregated. This is inconvenient.
It would be more convenient to have a validation as a property for each Field:
less maintenance when Fields are added or removed
less code (no need in dedicated function)
In most cases regex expression per-Field level is enough.
This was perfectly implemented in DHTMLx library: regex validation per field level.
Validation can be assigned to each field separately. Any input in the form ( or in the toolbar ) can have a custom “validate” property ( attribute ), which will be used during form validation.
As for regexp, isn’t it better to store validation rules in one place, so they can be easily reused or changed ?
//once per app
webix.rules.intNumber = function(val){ return /[0-9]+/.test(val); }
//and you can use in any place
webix.ui({ view:"form", elements:[
{ view:"text", validate:"intNumber" }
]});