I would like to have an input textfield that only accepts numeric input. I did not find a text of type “number” in Webix. But I did find a rule that states the field should be numeric: webix.rules.isNumber
The only problem is: when using this rule, the field is always required.
Is it possible to create a numeric input field that is not required?
Great! I didn’t find any documentation on setting the attribute “type” to “number”. I tried setting “view” to “number” instead of “text” (similar to the types “email” etc), but that did not work. It’s kind of confusing.
attributes allows to set a custom attribute on the HTML input tag. In above snippet it changes the raw HTML <input type='text'> to the <input type='number'>
Out of curiosity, where is this documented? I only found this:
“Input types conside with a type property of the view text while other input attributes are listed within the attributes object property”.
There’s nothing that indicates that I could actually change the input type of the text field by using attributes. Even more, if you want to change the type to “password”, “email” or “url”, you have to do so by changing the type of the component, not the type-attribute, according tot he documentation. Why is there a different way of working for the input type “number” and input type “email”?
So, you can’t use them. And there is no documentation for it, as they don’t exist.
The above solution allows to modify the raw HTML data, generated by widgets. This functionality is not cross-browser ( will not work in old IE ) so it is not a standard and not a recommended solution, just a workaround for your use-case.
I tried to make complex form for business app and was confused by lack so important kind of input text - number field that not allows letters. I want it would filter letters and other symbols while I typing but not while verifying all form’s data