Forms - validation - Ideas & Feature Requests - Ideas & Feature Requests - Progress Community
 Ideas & Feature Requests

Forms - validation

  • Forms - validation
  • 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.
  • 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

  • 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.
  • 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

  • Dear Boyan

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

    Thanks
  • www.sitefinity.com/.../validating-the-user-input

     Just to update.

    Markus

  • 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

  • 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!

  • 47b04f1e-37c1-6deb-a958-ff0000446526_regex.png

    Dear Beth

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

     Markus

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

  • Dear Beth

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

    Have a nice day

    Markus