Hi All
Validation is very important in user input screen (HTML forms), because invalid data may get entered while inputting.
For example the age should be between 20 and 25, name shouldn't be left blank, email validation etc.
Let me show you how to set these conditions on a text. You can try the same on multiple textboxes.
Let me guide you through a few screen shots.
Step 1. Design the screen first with text box.
See the validation area which is highlighted.
For each textbox drag the required validation items near the textboxes.
At first I am placing the 'Required Field Validator' near Name text box and 'Range validator' for age (To set age range between 20 and 30)
Now we are going to connect the validators with the concerned text boxes. For this we should select that validator and right click to see the properties.
See the 'Control to Validate' option in the properties. There you select 'TextBox1', which is the name.
You can change the Message to be shown using the 'Error Message' property from the same list.
You repeat the same for Age also. There in the property list you can find 'Minimum Value' and 'Maximum Value' properties to set the range.
Try this and put your feedback.
All the best.
Validation is very important in user input screen (HTML forms), because invalid data may get entered while inputting.
For example the age should be between 20 and 25, name shouldn't be left blank, email validation etc.
Let me show you how to set these conditions on a text. You can try the same on multiple textboxes.
Let me guide you through a few screen shots.
Step 1. Design the screen first with text box.
See the validation area which is highlighted.
For each textbox drag the required validation items near the textboxes.
At first I am placing the 'Required Field Validator' near Name text box and 'Range validator' for age (To set age range between 20 and 30)
Now we are going to connect the validators with the concerned text boxes. For this we should select that validator and right click to see the properties.
See the 'Control to Validate' option in the properties. There you select 'TextBox1', which is the name.
You can change the Message to be shown using the 'Error Message' property from the same list.
You repeat the same for Age also. There in the property list you can find 'Minimum Value' and 'Maximum Value' properties to set the range.
Try this and put your feedback.
All the best.





No comments:
Post a Comment