PHP Code:
function zen_get_word_count($string, $free=0) {
$string = str_replace(array("\r\n", "\n", "\r", "\t"), ' ', $string);
PHP Code:
function zen_get_letters_count($string, $free=0) {
$string = str_replace(array("\r\n", "\n", "\r", "\t"), ' ', $string);
Note: the java counter also needs an update in the:
/includes/modules/pages/product_info/jscript_textarea_counter.js
Code:
/* javascript function to update form field
* field form field that is being counted
* count form field that will show characters left
* maxchars maximum number of characters
*/
function characterCount(field, count, maxchars) {
var realchars = field.value.replace(/\t|\r|\n|\r\n/g,'');
var excesschars = realchars.length - maxchars;
if (excesschars > 0) {
field.value = field.value.substring(0, excesschars);
alert("Error:\n\n- You are only allowed to enter up to"+maxchars+" characters.");
} else {
count.value = maxchars - realchars.length;
}
}
The functions fix the price ...
The java fixes the counter in the box ...