how to enter number only without any symbol ex: +,-...etc

How to allow to type number only without validation…

webix input

{
   view:"text", on:{
      onkeypress:function(code, e){
        if (code < 48 || code > 57) {
          return webix.html.preventEvent(e);
        }
      }
    }

https://docs.webix.com/api__ui.text_pattern_config.html

{ 
    view:"text", pattern:{ mask:"#########################################################", allow:/[0-9]/g}
}

Thanks But

Mask any option for infinity number etc…######…

mask:"#####################################################"

https://snippet.webix.com/v3ruj89u

{ view:"text", name:"card", pattern:{ mask:'#'.repeat(Math.pow(2,10)), allow:/[0-9]/g} }

Thanks

Hi @jprakashrpm

pattern is intended for strict limitation of input content, and enables the corresponding validation. The following code

mask:'#'.repeat(Math.pow(2,10))

will be used as a rule for validation and the input will be considered as invalid till the number contain 2^10 characters:

https://snippet.webix.com/2a0sgie5

So I would rather suggest two alternatives:

  • declare a corresponding html attribute (see the snippet above),
  • use formatted input to cut off the invalid symbols

Hi Listopad,

how to allow space.

Thanks.,

Hi @naveen

You can either customize regexp in pattern (if it suits your use-case) or set custom format for input as described in the docs referenced above.

An ui.text with attributes:{type:"number"} is the only option that cannot be used in such case, as it mimics the regular <input type="number"> where spaces are not allowed.

validation in mask pattern using can be overridden by custom validate method
https://snippet.webix.com/416c90sr

Hi ,

    i want to allow the character and number with specified symbol( - ) in

webix pattern

Example here

https://snippet.webix.com/iv2mbald

i want to enter - symbol

Hello @jprakashrpm ,

Please, follow the discussion with a similar issue