Closed DavidDurman closed 9 years ago
In some text text input fields on the Inspector I would like to validate the input against some regexp. This can be done either via the HTML 5 pattern attribute in a fashion similar to this:
attrs: { input: { pattern: '[_a-zA-Z][_a-zA-Z0-9]*', required: 'required' } }
--- joint.ui.inspector.js (revision 1013) +++ joint.ui.inspector.js (working copy) @@ -1155,6 +1155,11 @@ onChangeInput: function(evt) { var $input = $(evt.target); + + if (! $input[0].validity.valid) { + return; + } + var path = $input.attr('data-attribute'); if (this.options.live) {
Or with some custom solution, for example by providing a custom validation function in the inspector options object.
Fixed. validateInput option added.
validateInput
how can use validateInput can you write an example please
In some text text input fields on the Inspector I would like to validate the input against some regexp. This can be done either via the HTML 5 pattern attribute in a fashion similar to this:
Or with some custom solution, for example by providing a custom validation function in the inspector options object.