Post by Peter on Apr 29, 2006 13:25:58 GMT
This will show you how many characters are left when posting.
<script type="text/javascript">
<!--
/*
Characters left
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times.
*/
function charsLeft(){
var cFont = document.createElement("font");
cTxt = document.createTextNode("Characters Left:");
var iCounter = document.createElement("input");
iCounter.id = "postcounter";
iCounter.size = "6";
iCounter.value = "25600";
iCounter.disabled = true;
cFont.size = "2";
cFont.appendChild(cTxt);
if(document.postForm){
var postTable = document.postForm.message.parentNode.parentNode.parentNode;
var cRow = postTable.parentNode.insertRow(postTable.rowIndex + 1);
var cCell = cRow.insertCell(0);
cCell.className = "windowbg";
cCell.appendChild(cFont)
cCell = cRow.insertCell(1);
cCell.className = "windowbg";
cCell.appendChild(iCounter);
}
}
function iMaths(){
if(document.postForm && document.getElementById("postcounter")){
var postLen = document.postForm.message.value.length;
document.getElementById("postcounter").value = 50000 - postLen;
if(document.getElementById("postcounter").value < 0){
document.getElementById("postcounter").value = 0;
}
}
}
if(location.href.match(/action=(pmall|pmsend|createpoll|post|modify)/)){
charsLeft();
document.onkeypress = iMaths;
document.onkeydown = iMaths;
window.onload = iMaths;
}
//-->
</script>
Global footers.
<script type="text/javascript">
<!--
/*
Characters left
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times.
*/
function charsLeft(){
var cFont = document.createElement("font");
cTxt = document.createTextNode("Characters Left:");
var iCounter = document.createElement("input");
iCounter.id = "postcounter";
iCounter.size = "6";
iCounter.value = "25600";
iCounter.disabled = true;
cFont.size = "2";
cFont.appendChild(cTxt);
if(document.postForm){
var postTable = document.postForm.message.parentNode.parentNode.parentNode;
var cRow = postTable.parentNode.insertRow(postTable.rowIndex + 1);
var cCell = cRow.insertCell(0);
cCell.className = "windowbg";
cCell.appendChild(cFont)
cCell = cRow.insertCell(1);
cCell.className = "windowbg";
cCell.appendChild(iCounter);
}
}
function iMaths(){
if(document.postForm && document.getElementById("postcounter")){
var postLen = document.postForm.message.value.length;
document.getElementById("postcounter").value = 50000 - postLen;
if(document.getElementById("postcounter").value < 0){
document.getElementById("postcounter").value = 0;
}
}
}
if(location.href.match(/action=(pmall|pmsend|createpoll|post|modify)/)){
charsLeft();
document.onkeypress = iMaths;
document.onkeydown = iMaths;
window.onload = iMaths;
}
//-->
</script>
Global footers.