What is the best way to limit text input entry to numbers, lowercase letters, and certain symbols?
<p>Without using jQuery, what is the best way to limit text entry of a textbox to numbers, lowercase letters and a given set of symbols (for example <code>-</code> and <code>_</code>)? If the user enters an uppercase letter, I would like it to be automatically converted to a lowercase letter, and if the user enters a symbol not within the given set, I would like to be able to instantly show a validation error (show some element adjacent to or below the text box).</p>

<p>What's the cleanest cross-browser way of doing this without the aid of jQuery?</p>
