Tygh.lang.min_500_words = '{__("min_500_words")|escape:javascript}';
Tygh.$.ceFormValidator('registerValidator', {
class_name: 'cm-500-min',
message: Tygh.lang.min_500_words,
func: function(id){
var x = fn_hw_word_count($('#'+id).val());
if(x.words<500) return false;
else return true;
}
});
function fn_hw_word_count(val){
return {
charactersNoSpaces : val.replace(/\s+/g, '').length,
characters : val.length,
words : val.match(/\S+/g).length,
lines : val.split(/\r*\n/).length
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.