Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jivan thapa 194 posts 681 karma points
    Apr 27, 2011 @ 00:07
    jivan thapa
    0

    How to reuse Umbraco out of box Validations

    HI, Is it possible to reuse Umbraco out of box Validation methods. I know how to validate textbox, email, Integer using Regex in user control. I am looking to validate Email, RemoveSpecialCharacter from textbox or other available methods to validate field using Umbraco out of box methods in Usercontrol.

    - Remover special character from Input Textbox and return.

    - Validate Email  and Check input data is  Interger or not?

    Any Idea?

    thanks.

     

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Apr 27, 2011 @ 07:08
    Jan Skovgaard
    0

    Hi Jeevan

    Do you want to use the same regular expressions as those you can use on properties in Umbraco in your usercontrol?

    /Jan

  • jivan thapa 194 posts 681 karma points
    Apr 27, 2011 @ 17:49
    jivan thapa
    0

    HI, jan, thanks for your replay.

    can you provide one example ?

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Apr 28, 2011 @ 08:00
    Jan Skovgaard
    0

    Hi Jeevan

    Well...on your document type you can add a validation rule for the specific property you make in the "validation" box.

    If you for instance create a textfield, which should only contain a correctly formatted e-mail address then you can write a regular expression that makes sure what is entered is only a valid e-mail address.

    If you enter something that is not a valid e-mail address the value will not be saved and you will receive a warning that the e-mail format is not correct when trying to save the value in the content section in the backoffice.

    Hope this makes sense.

    /Jan

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies