Pages

Wednesday, June 1, 2011

Validating input using jquery (alphanumeric)

Best practices of UI development, make sure all your input fields such as textbox is validated before sending to the server.
There are many hackers who can enter malicious code that could destroy your web server.


jquery has a plugin that is so easy to implement.

Simply download the jquery plugin and add the following code snippet in your aspx page where the user input is

 
$('#QueryText').alphanumeric({ ichars: '<>' }); 
 
where 'QueryText' is the class name of your input control.

Reference:
jquery alphanumeric plugin

No comments: