title: Textbox problem with regex
body: <p>I have used a regex function on a textbox, but it's not working.</p>
  
  <pre><code>&lt;input name="title" class="txtbxinput" id="title"
  onblur="showsongstatus(this.value);title(this);" 
  onkeyup="title(this);" size="58" &gt;
  
  function title(f) {
     f.value = f.value.replace(/[^a-zA-Z\s.'-]/gixsm,'');
     f.value = f.value.replace(/\s\s+/g, '\s'); //remove more than 2 white spaces.
     f.value = f.value.replace(/'{2,}/g, '\'');
     f.value = f.value.replace(/--/g, '-');
     f.value = f.value.replace(/\.\./g, '\.');
  return f;
  }
  </code></pre>
  
  <p>I have restricted it for alphabets, hyphen, dots, and single quotes.</p>