Word Count in Posts Code:
Global Footer:
<script type="text/javascript"><!--
if(document.postForm && document.postForm.message) {
var i = document.createElement("input"), x = document.postForm.message;
i.value = "Word Count";
i.disabled = true;
i.type = "text";
i.id = "lg";
x.parentNode.appendChild(i);
document.onkeyup = function() {
document.getElementById("lg").value = (x.value ? x.value.match(/\b/g).length / 2 : 0);
}
}
//--></script>
if(document.postForm && document.postForm.message) {
var i = document.createElement("input"), x = document.postForm.message;
i.value = "Word Count";
i.disabled = true;
i.type = "text";
i.id = "lg";
x.parentNode.appendChild(i);
document.onkeyup = function() {
document.getElementById("lg").value = (x.value ? x.value.match(/\b/g).length / 2 : 0);
}
}
//--></script>
Code Database:
If you have a Code Database (a forum that serves as a collection of scripts) on your message board, you may paste the following code into that forum to add it your own code list.
[b]Title:[/b] [url=http://proboards.gamingmedley.com/codes/word-count-in-posts.html]Word Count in Posts[/url]
[b]Creator:[/b] Unknown
[b]Cross-Browser:[/b] Yes
[b]Placement:[/b] Global Footer
[code]<script type="text/javascript"><!--
if(document.postForm && document.postForm.message) {
var i = document.createElement("input"), x = document.postForm.message;
i.value = "Word Count";
i.disabled = true;
i.type = "text";
i.id = "lg";
x.parentNode.appendChild(i);
document.onkeyup = function() {
document.getElementById("lg").value = (x.value ? x.value.match(/\b/g).length / 2 : 0);
}
}
//--></script>[/code]
[b]Creator:[/b] Unknown
[b]Cross-Browser:[/b] Yes
[b]Placement:[/b] Global Footer
[code]<script type="text/javascript"><!--
if(document.postForm && document.postForm.message) {
var i = document.createElement("input"), x = document.postForm.message;
i.value = "Word Count";
i.disabled = true;
i.type = "text";
i.id = "lg";
x.parentNode.appendChild(i);
document.onkeyup = function() {
document.getElementById("lg").value = (x.value ? x.value.match(/\b/g).length / 2 : 0);
}
}
//--></script>[/code]