I found following code here at :

[How to validate html textbox not to allow special characters and space?](https://stackoverflow.com/questions/24774367/how-to-validate-html-textbox-not-to-allow-special-characters-and-space)

So Ive written this code for validation, but it is not working.

```
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>

<input type="text" name="txtUsername" id="txtUsername" data-validation="alphanumeric" data-validation-allowing="_" value="">

```

Should I write any script to not allow special characters in textbox.