Function to use with multiple elements
<p>I have modified a function to meet my need. This is what I have written to restrict multiple repetition of dots:</p>

<pre><code>$('#title').val(){
    replace(/\.{2,}/g, '.');
});
</code></pre>

<p>Is it correct? How can I make this in function so I can call with every element of the form?</p>
