JavaScript/jQuery validation for text box
<p>I have a texbox that is like this:</p>

<pre><code>&lt;input type="text" size="30" name="form[id]" id="form_id"&gt;
</code></pre>

<p>I need a JavaScript function that will validate:</p>

<ol>
<li>No Spaces allowed.</li>
<li>Only numbers, letters, dashes(-) and underscores(_) allowed and no other special character allowed.</li>
<li>Shouldn't be empty</li>
</ol>

<p>On Submit when the user's input is violating a validation. An alert message should be displayed.</p>
