Javascript for validating textbox in asp net

Rated 3.90/5 based on 511 customer reviews

Validation server controls are a series of controls that help you validate the data that the user enters into the other controls that are provided with ASP. They determine whether the form can be processed based upon the rules that you define in the validation server controls.One of the most common elements of Web pages is a form in which the user can input data that is posted back to the server.Actually, In developer perspective It can be hacked by some one else, let see the example, I'm going to see the page through inspect element and I replaced the button return value to be "true" instead of "return Validate();", now it would give some burden.In that case how could I make my application to be efficient and secured. for the next requirement of yours ie., for checking if it is 6 letters followed by 6 numbers, i suggest that u can use the regular expression validator control and get the text box validated. Say if u have a txt box labeled "txtuserid" and a label to display error "lbl Error" u can use the following function in java script to check the length and display error if the length is less than 12.

javascript for validating textbox in asp net-51

This takes a lot of resources and makes for a slower-paced form for the user.

Some users are not interested in spending enough time to enter the correct information into a form, and in some cases, users might even intentionally enter false information to gain access or get past a certain step in your application's workflow process.

One of the first steps is to understand what validating data means.

Data collection on the Internet is one of its most important features, so you must make sure that the data you collect has value and meaning.

You ensure this by eliminating any chance that the information collected does not abide by the rules you outline. NET don't know the difference between client-side and server-side validation.

Leave a Reply