The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
The Forms module is one of the new great features we introduced in Sitefinity 4. You can use it to robustly build various user interaction forms, polls, questionnaires and more with the intuitive Sitefinity drag-and-drop interface.
Today we’ll explore the option to add validation to the text boxes, which are possibly the mostly used elements in every form. Let’s first create our form and add some widgets to it:
Now, if we would like to make sure that our visitors fill out the text boxes, there is a tick we can select in the text box’s designer window, which would make any of these fields are required:
So far, so good! However, what if we would like to make sure that the fields are filled out with content with a specific format? For example Text, Number or e-mail address? That’s absolutely possible and easy too! We need to go into the Advanced options of the textbox widget first:
and then proceed down to ValidatorDefinition:
Here we can fill out the field ExpectedFormat with the formatting the visitor is supposed to follow:
The different formatting options are listed in the offline Sitefinity documentation, that's available with the SDK. For ease of access, I've enclosed them below:
And that’s that – validation is already in place! Let’s test the result:
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.