+1-888-365-2779
Try Now
More in this section

Forums / Suggestions / Forms - validation

Forms - validation

11 posts, 0 answered
  1. Allen
    Allen avatar
    71 posts
    Registered:
    04 Aug 2007
    04 Apr 2011
    Link to this post
    It would be great in the forms module if there were a way to validate entry into some fields other than required or not.  Maybe I am missing something, but I would like the ability to have validation tests for SSN or phone number, etc.  I am assuming that I could create a custom field type, but a simple RegEx expression on a built-in text field would be better.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    19 Sep 2016
    05 Apr 2011
    Link to this post
    Hi Allen,

    You can set forms validation from the UI by setting the ValidatorDefinition in the advanced settings of your text box. Please refer to this blog post for more information.

    You can also use client side validation in the template of your designer or try validating the field you want inside your designer script. This thread form our forums explains in detail how you can achieve this.

    I hope this information helps. Please contact me if you need further assistance with this issue.

    Greetings,
    Boyan Barnev
    the Telerik team

  3. Allen
    Allen avatar
    71 posts
    Registered:
    04 Aug 2007
    05 Apr 2011
    Link to this post
    I've seen these types of validation.  Is there a way to create your own?  Particularly, I would like validation for email address.  However, I would like other ones as well, phone number, SSN, etc.  I am reading your post on the JavaScript, but given all the special circumstance my user-base comes up with, I see nothing but edits - substantial edits. That is a little daunting.  It seems that a regular expressions validation would cover almost anything.  Anyway, thanks for the feedback.
  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    19 Sep 2016
    07 Apr 2011
    Link to this post
    Hello Allen,

    Thank you for getting back to me. I have logged this functionality as a feature request in our system.To vote for it and follow its status you can visit this public URL. For now you can achieve this through code by setting this.Validator.RegularExpression to the desired regular expresion or if you have custom definition, you can read it from there. Another option, if you're using a custom designer for the field controls is to set this property from the designer.

    All the best,
    Boyan Barnev
    the Telerik team

  5. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    11 Oct 2011
    Link to this post
    Dear Boyan

    This is realy very common so please consider adding a regex for e-mail adresses.

    Thanks
  6. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    20 Aug 2014 in reply to Markus
    Link to this post

    http://www.sitefinity.com/documentation/documentationarticles/validating-the-user-input

     Just to update.

    Markus

  7. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    03 Sep 2014 in reply to Markus
    Link to this post

    Dear Boyan

    I started to make blog posts about stuff I came along in Sitefinity but probably am goint to forget again (old age). Sitefinity Hidden treasure

    Forms are such a great feature but if I have to make mental notes that this is possible and how to do it - it will be absolutely impossible for my clients.

    Could you consider a dropddown in the UI where the end user can set the type of validation?

    Markus

  8. Beth
    Beth avatar
    29 posts
    Registered:
    30 Oct 2013
    14 Sep 2014
    Link to this post

    I am trying to validate a number that cannot be more than 10 digits long. I've tried every combo of field types/limits/etc. and can't seem to get it to care how long the number is. Please see the attached doc for a summary of my current settings. Using these settings, I can succesfully submit numbers like:

    123092847091823740129384701293847102938471029384710293847

    What am I missing? What fields do I need to have set to require an entry to be numbers only, at least 9 numbers, but no more than 10.

     

    Thanks!

  9. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    15 Sep 2014 in reply to Beth
    Link to this post

    Dear Beth

    Can you try this as in the attached screenshot. Advanced options.

     Markus

  10. Beth
    Beth avatar
    29 posts
    Registered:
    30 Oct 2013
    16 Sep 2014 in reply to Markus
    Link to this post

    Ah! So that's how to get regular expressions to work. Thank you!

  11. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    17 Sep 2014 in reply to Beth
    Link to this post

    Dear Beth

     No problem. Hope you got it working the way you want it.

    Have a nice day

    Markus

11 posts, 0 answered