Q:

Count the characters from multiple text box values with single max value using jquery

I want to count the characters using multiple text box. i search so many links and stack overflow answers also. But i am not getting the correct answer. i have reviewed the answer the below link, but this one is having two types of max count for two text boxes. But In my case I want to count using the max character 160 for all text boxes. It should combine all those inputs and every time it should count the values JQuery character counter with multiple inputs 
My code here
$('#Loc').keyup(function () {

            var len = $(this).val().length;
            var $msg = $("#charNum");
            if (len > 160) {
                var output = $(this).val().substring(0, 160);
                var msglength = 2;
                //$(this).val(output);

                $msg.html(len + "/" + msglength + " sms left");
            } else {
                $msg.html(160 - len + " characters left");
            }
        });

The above code is for first text box. 
 $('#Contn').keyup(function () {
            var Vaclen = $('#Vac').val().length + $('#Loc').val().length;
            var len = $(this).val().length;
            var $msg = $("#charNum");
            if (len > 160) {
                var output = $(this).val().substring(0, 160);
                var msglength = 2;
                //$(this).val(output);

                $msg.html(len + "/" + msglength + " sms left");
            } else {
                $msg.html(Vaclen - len + " characters left");
            }
        });

I have attached screenshot. 
How to combine the all text boxes values and how ll show ?
My fiddle here

A:

Try this jQuery :
Here you need to write two events for input text. One is on focus where you will calculate total text length except for focused input and another is keyup event for focused input where you have to get total text length for all input.
$(document).ready(function () {
            var count = 0; // 
            var focusCount = 0;

        $('input[type=textbox]').focus(function(){

            focusCount = $(this).val().length;
            count = 0;              
            // get total text length
            $('input[type=textbox]').each(function(){
                count +=  $(this).val().length;
            });
            // remove text length of focused input from total count
            count-=focusCount;
        });

        $('input[type=textbox]').keyup(function () {
                focusCount = $(this).val().length;
               $('#charNum').text(160 - (count+focusCount));
        });
    });

Working JSfiddle

