Validation Pattern dash in numbers

This topic contains 13 replies, has 3 voices, and was last updated by  Kiran 5 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #520489

    malinka
    Lifetime Member
    Post count: 18

    Hi

    I have made a custom text field set to numbers and i have tried to make a regex to accept dash in the custom field but havent succeed.

    I want to be able to input this kind of number pattern: 556059-8434

    When i import csv with custom text field all numbers transform from 556059-8434 to 556059

    I have tried https://stackoverflow.com/questions/8760924/c-sharp-regex-for-numbers-and-dash-only and this https://stackoverflow.com/questions/48662794/how-to-make-html5-pattern-for-allow-numbers-and-dash-any-where-between-them

    Best regards
    Malinka

    #520515

    Alex Rollin
    Moderator
    Post count: 27815

    A field that must include a dash must be a string/character, not number, as far as I know. Try that and let us know.

    #520746

    malinka
    Lifetime Member
    Post count: 18

    I changed from number to character string in text field but i had no success.

    Best regards
    Malinka

    #520885

    Alex Rollin
    Moderator
    Post count: 27815

    You are having trouble with the import? Or the form validation?

    #520970

    malinka
    Lifetime Member
    Post count: 18

    Import dosent display correct after importing this 556059-8434 it display this 556059

    And validation i cant get to work.

    Best regards
    Malinka

    #521138

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #521360

    malinka
    Lifetime Member
    Post count: 18
    This reply has been marked as private.
    #521407

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #521601

    malinka
    Lifetime Member
    Post count: 18
    This reply has been marked as private.
    #521696

    Kiran
    Moderator
    Post count: 7069

    Hi malinka,

    I have created new text field and saved fine “556059-8434” with same validation pattern “^\d+(?:-\d+)*$”

    Please provide us full admin access & FTP credentials to look into more.

    Kiran

    #521739

    malinka
    Lifetime Member
    Post count: 18

    Did you upload thetest with a csv file ?

    In case of that i can upload all numbers with this pattern 556059-8434 to thetest column.

    Best regards
    Malinka

    #521910

    Kiran
    Moderator
    Post count: 7069

    I have tested it from backend listing edit page. You can also test from there.

    Kiran

    #522755

    malinka
    Lifetime Member
    Post count: 18

    Hi now i have test upload csv and succeed.

    Merry Christmas and a Happy New Year

    Best regards
    Malinka

    #522872

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 14 posts - 1 through 14 (of 14 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount