How to allow to enter minus symbol "-" in webix pattern ?

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 allow enter the field are given below mentioned only.

1." - "

2.number

3.text

Thanks

Comments

  • Hello,

    You can find information about Formatted Text Inputs here

    The predefined patterns are stored as "property-value" pairs, where property is the rule name and value is an object with mask and allow properties. You can create a "custom" pattern as:

    webix.patterns.custom = {
        mask:"## ## - ### #####", allow:/[0-9]/g 
    };
    
    //or
    webix.patterns.custom = "## ## - ### #####";
    

    i want to allow enter the field are given below mentioned only.

    you can set a validation rule for an input using the validate property.

  • hI Nastja,

    yes i know webix custom pattern . "MASK" is allowing the - minus symbol by predefined one.. but user can be type random( a-z && - && 0-9 ) like .

    ISBN FILED VALUE = FIRST-ISBN-001
    ISBN FILED VALUE = ISBN-02-ABC

    https://snippet.webix.com/iv2mbald

    without webix pattern if any option there ?

    My rule is:
    user keypress the filed to allow [a-z] [0-9] [minus] [dot.]

    Thanks

  • edited September 2018

    Hi,

    Maybe format helps you to solve it.
    Please check the example: https://snippet.webix.com/x6s97hj2

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!