1 // https://stackoverflow.com/a/1054862/485063
2 jq('.input.slug, .slug, input .slug').unbind().bind('keyup paste', function(){
3 var low= jq(this).val().toLowerCase()
4 .replace(/ /g,'-')
5 .replace(/\_/g,'-')
6 .replace(/[^\w-]+/g,'')
7 .replace(/\-\-+/g,'-');
8
9 jq(this).val(low);
10 });
11