IPv4 Address regex mask

2 posts, 0 answers
  1. Emin Inam
    Emin Inam avatar
    6 posts
    Member since:
    Oct 2004

    Posted 24 Feb Link to this post


    I need to validate user input for ipv4 adress. I am using maskedtextbox. How can i set mask property of maskedtextbox?

    I write this code but it doesn't work. ?

    <input id="maskedtextbox" />
        mask: "~",
        rules: {

  2. Viktor Tachev
    Viktor Tachev avatar
    1799 posts

    Posted 28 Feb Link to this post

    Hello Emin,

    I am afraid that there is currently no built-in rule for IP addresses. However, you can implement the behavior with a bit of additional logic. You can define the MaskedTextBox as below:

        mask: "",

    Then, you would need to validate the input. For that you can use the Validator component and specify a custom rule.

    Check out the following example for illustration.

    Viktor Tachev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top