i want that the first two characters of my string should not be special characters
<p>I want that the first two characters of my string should not be special characters</p>

<pre><code>function detectInvalidChars(limitField)
{
    var len=limitField.value.length;
    var char1=limitField.value.substring(0,1);
    var char2=limitField.value.substring(1,2);

    if(char1=='&amp;'||char1=='&lt;' char1=='!' || char2=='&amp;'||char2=='&lt;'..........so on)
    {
    alert("Invalid character");
    limitField.value = limitField.value.substring(0,len-1);
    }
}
</code></pre>

<p>instead of matching the <code>char1</code> and <code>char2</code> with each special character. What can I do?</p>
