Custom Field accept only positive integer

This topic contains 4 replies, has 3 voices, and was last updated by  ian bran 5 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #438817

    ian bran
    Expired Member
    Post count: 122

    Hello,
    I see that in custom fields there’s a “Validation Pattern” option where you can enter a regex expression.

    I’ve tried inputting some expressions with no success… ^\d+$ ; ^(0|[1-9][0-9]*)$.

    When user submits the listing and entered, eg. -4, there’s no validation message, so I must have done it wrong.

    I’m not sure how to use this and found no other tickets, could you give me a hand?

    *Actually all numeric inputs should be positive in my website

    Thank you

    #438832

    Paolo
    Site Admin
    Post count: 31206

    Hi Ian,

    I’ve alerted the developers about your request. The 1st to come back online will let you know how to solve this.

    Thank you,

    #438837

    ian bran
    Expired Member
    Post count: 122

    Thank you Paolo!

    #438896

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Ian,

    What is it your trying exactly? The html5 validation is a bit different from JS regex.
    This website is a good resource http://html5pattern.com/Make_Your_Own

    Thanks,

    Stiofan

    #438943

    ian bran
    Expired Member
    Post count: 122

    Hi Stiofan,

    Eg. I have a CF called “Number of Assistants”.
    I would like users not to be able to input, eg. -10 (no negative numbers).

    I gave it a go with the link you sent, but I didn’t understand it :S

    Thank you

    *Zero is ok (it will output “Not Available”)

Viewing 5 posts - 1 through 5 (of 5 total)

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

Open Support Ticket