Validating text input


The different types of validators are listed as follows: Write a web page to collect a new user id and password.The user id must contain 6-10 alpha characters and must not already be in use.For example, if you want to check whether or not user input in a text box is (a) nonblank, (b) a valid date between a particular range and (c) less than the date in another text input control, you would want to use three validators.While this might seem cumbersome, remember that to be helpful to the user, you would want to have three different text descriptions for all these cases.Validation controls change all that, because almost all the duplicated logic is encapsulated in the controls.If a client with Internet Explorer 4.0 or later uses your page, it can do the same input validation that takes place on the server without you having to write any special client script.In HTML 3.2, validating data is a difficult process.Each time you get a request, you need to write code to check the input and write any errors the user has made back to the page to help the user to correctly fill in the form.

In my windows form projects , i have validated the fields using Boolean method.

In a Win Form I'm doing initial validation in the Form. To make the code short only three fields are shown in the code.

So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. I would rather use a generic function that would be passed each control on the form and based on the type of the control, separate validation logic would be written.

There are five types of validator controls that perform different types of checks.

Another element in our solution is the Validation Summary control.

The client side validation has a number of features: In order to use validators effectively, it helps to have a firm definition of what they are.

You must have an account to comment. Please register or login here!