Removing Double space from a textbox using REGEX
<p>Input: </p>

<pre><code>"I want         to   remove        double     space    from    textbox."
</code></pre>

<p>Output: </p>

<pre><code>"I want to remove double space from textbox."
</code></pre>

<hr>

<pre><code>function valid(f) {
     return f.replace(/^\s+|\s+$/g,'').replace(/\s+/g,' ');
}
</code></pre>

<p>I have called this event <code>onblur="valid(this);"</code></p>
