-
Book Overview & Buying
-
Table Of Contents
SharePoint Designer Tutorial: Working with SharePoint Websites
By :
We can add validation controls to our form that will check the information input by the user. If they input an incorrect value, then an error message will be displayed.
There are several different types of validation controls. Each performs a specific type of validation when the form is updated.
We will add a RangeValidator to our form to check that the birthday we have selected is credible:
Click and drag a RangeValidator control onto our form.
Right-click on the validation control and select Properties from the shortcut menu.
Set the ControlToValidate to txtBirthday.
Change the Type from String to Date.
Set the MinimumValue to 1/1/1880.
Set the MaximumValue to 1/1/2009.
Set the ErrorMessage to Please select a credible birthday.
If we return to our birthday page in our web browser, we see that if we enter a spurious date such as 1/1/1850 and then press Enter to cause a postback, the validation kicks in and we are greeted with an error message.
Change the font size
Change margin width
Change background colour