I've modified your code, check if this help you...
function abc(value) {
var count = 0;
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
var text = value;
var array = value.split("");
for (var i = 0; i < array.length; i++ ) {
if (iChars.indexOf(array[i]) != - 1) {
count++;
if (count == 2) {
text = value.substr(0, value.lastIndexOf(array[i]));
break;
}
}
}
if (count == 2) {
alert("u cannot enter more than one special charecter");
}
document.getElementById("Txt1").value = text;
}