special character validation in javascript
<p>i am trying to write a validator which could validate the bunch of commas like (,,,,,,,,,)
if single comma(,) is there then its ok . 
here is my code </p>

<pre><code>function test() {

    var iChars = ",,";
    for (var i = 0; i &lt; document.mform.show_time1.value.length; i++) {
        if (iChars.indexOf(document.mform.show_time1.value.charAt(i)) != -1) {
            alert("The box has special characters. \nThese are not allowed.\n");
            return false;
        }
    }
}       
</code></pre>

<p>but the above script is also validating (,)  that i don't want .</p>

<p>Any idea how to do that ?? </p>
