Ok, so this is what I have (special thx to Tushar Gupta, for fixing the code)
HTML
<input type='checkbox' value='2' name='v'>STS
<input type='checkbox' value='4' name='v'>NTV
js
$(function () {
var wordCounts = {};
$("input[type='text']:not(:disabled)").keyup(function () {
var matches = this.value.match(/\b/g);
wordCounts[this.id] = matches ? matches.length / 2 : 0;
var finalCount = 0;
var x = 0;
$('input:checkbox:checked').each(function () {
x += parseInt(this.value);
});
x = (x == 0) ? 1 : x;
$.each(wordCounts, function (k, v) {
finalCount += v * x;
});
$('#finalcount').val(finalCount)
}).keyup();
$('input:checkbox').change(function () {
$('input[type="text"]:not(:disabled)').trigger('keyup');
});
});
I want it to be able to count up Russian words e.g "Привет как дела", so far it only works with English input