Wednesday, March 28, 2012

JQuery Plugin to validate user inputs and to Add watermarks

JQuery is a JavaScript library that can be used to validate user inputs of our web forms. Following is a jQuery plugin that can be used to validate user inputs. And also to add watermarks.

First function is to add a watermark. Here we need to pass the pattern as a parameter.

Second method is to validate the user inputs. In here if the user input is not valid, then the label will turn to red color. Here need to pass two parameters. Label ID and the regular expression.  





















Following image shows how to call the methods:

Following is the aspx page:


Followin image shows the UI:

No comments:

Post a Comment