I have a large text input area where users will query information from a database. I want to restrict input to only alphanumeric keys to help prevent SQL injection. I was using a RadTextBox with the multiline attribute set and I had attached the jQuery script alphanumeric to the field, but it disabled the browser context menu. I decided to give the RadEditor a try since it allows for custom context menus and for a toolbar. The jQuery alphanumeric plugin is very nice and if there is any way to attach the script to the content area of the RadEditor, I would appreciate it. If there is another way to achieve the same effect, let me know. Thanks.
This is the basic syntax for applying the alphanumeric filter to a textbox:
<script type="text/javascript"> |
$('.textbox').alphanumeric({ allow: "_-* " }); |
</script> |
Then you would have an element such as a RadTextBox or a plain TextBox and apply '.textbox' to the the CssClass attribute.