|
Post by Wormopolis on Jan 1, 2009 23:07:17 GMT -8
Browser Tested: IE and FF placement: main footer
Makes it so a user cant send a PM without a subject.
IMPORTANT NOTE: This script will overwrite the normal "onsubmit" action of the PM form. If you have any other codes that use attachEvent on the submit function, this code will OVERWRITE their effect. therefore this code should be ABOVE those codes.
<script type="text/javascript"> <!-- // Subject required in PM // by Wormopolis // Do Not Repost - keep header intact // version 1
if (document.postForm) { document.postForm.onsubmit=function() {if (document.postForm.subject.value=='' || document.postForm.subject.value=="(No Subject)") {alert("Please type in a subject"); return false;}}; chk=document.getElementsByTagName('td'); for (k=0; k<chk.length; k++) { if (chk[k].className=='titlebg' && chk[k].width=='100%' && chk[k].innerHTML.match(/error sending message/i)) { lst=chk[k].parentNode.nextSibling.firstChild.firstChild.lastChild.lastChild; nwlst=lst.cloneNode(true); nwlst.firstChild.nodeValue="You did not enter a Subject"; if (document.postForm.subject.value=='' || document.postForm.subject.value=="(No Subject)") lst.parentNode.appendChild(nwlst);
} } } // --> </script>
preview: just an alert...
future upgrade: page refresh or preview lists an error as well.
|
|