title: should not allow more than one space in between words
body: <pre><code>function stripspaces(input)
  {
      input.value = input.value.replace(/\s+/gi," ");
  
  }
  </code></pre>
  
  <p>I written this function. It is working but when I point the mouse pointer or moving with left arrow in between word and giving space it is jumping to the last. Can anyone give me the solution?</p>