I count characters using NobleCount and the following code:
$('#message').NobleCount('#messageInfo',{
max_chars: getMaxChars(),
on_negative: function(t_obj, char_area, c_settings, char_rem){
}
});
I want a feature like counting SMS, if the limit is reached the next 160 chars are for the second sms and so on. I can use parameters like on_update, on_positive, on_negative and block_negative.
I tried something using modulo but it does not work. Any ideas?
Firstly, character counting is very easy. You just need to use the
lengthproperty on a string. To count the number of SMS messages needed, you’ll need to divide by 160 and round up (because 161 characters requires 2 messages). Your code should probably look something like this:HTML:
jQuery:
See jsFiddle example.