Skip to content

Instantly share code, notes, and snippets.

@M1ke
Created June 24, 2012 13:53
Show Gist options
  • Save M1ke/2983298 to your computer and use it in GitHub Desktop.
Save M1ke/2983298 to your computer and use it in GitHub Desktop.
PHPNW12 Talk Submission Word Count
var count=0;
$('#cf_field_4').unbind('keyup').keyup(function(){
var words=($(this).val().split(" ").length);
if (words!=count)
{
$(this).next().html(words+' words');
}
count=words;
});
var count2=0;
$('#cf_field_11').unbind('keyup').keyup(function(){
var words=($(this).val().split(" ").length);
if (words!=count2)
{
$(this).next().html(words+' words');
}
count2=words;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment