I've designed sms sending page to send SMS. I'm showing a character count counting down from 160, using Javascript. The problem is that I don't know how to calculate number of SMS after every 160 characters.
my code in js function:
function CountCharIndividual(txtIndividualMessage) {
var count = document.getElementById(txtIndividualMessage).value.length;
if (count > 1 && count <= 160) {
document.getElementById('charstatus2').innerHTML = 160 - document.getElementById(txtIndividualMessage).value.length;
}
if (document.getElementById(txtIndividualMessage).value.length > 160 - 1) {
document.getElementById('charstatus2').innerHTML = "Maximum characters reached & now " + "showing new count: " + document.getElementById(txtIndividualMessage).value.length;
}
if (document.getElementById(txtIndividualMessage).value.length >= 160) {
document.getElementById('smsCount').innerHTML = 1;
}
}
It's showing for the first 160 characters in the smsCount's innerHTML but not increasing then on.