Sorry dear it's my new code according to your question it's working fine according to me, if you feel any issue there you can contact to me syedasim8@hotmail.com
function GetValues() {
var val = document.getElementById('<%=TextBox1.ClientID %>').value;
var alphaArray = "abcdefghijklmnopqrstuvwxyz";
var totalChars = alphaArray.length;
var index = 0;
var subtotal = 0;
if (val.length == 1) {
index = alphaArray.indexOf(val) + 1;
}
else if (val.length == 2) {
var firstChar = val.substring(0, 1);
var secondChar = val.substring(1, 2);
var charPosition = totalChars * (alphaArray.indexOf(firstChar) + 1);
index = (alphaArray.indexOf(secondChar) + 1) + charPosition;
}
document.write(index);
}
Please don't forgot to give me points.
Thanks