Post by deadlyassassin on Feb 10, 2006 14:53:07 GMT -5
Ok, this was a code request yet again but i thought i will share it for all to use. The header is self explanatory. No need to edit.
Global Footers or Board Footers
<script type="text/javascript">
<!--
/* Force Guest To Submit Email Before Posting
By {XF}Äs$@§sîñ™, www.xf-clan.net/
Keep Header Intact
Code from www.utopiangfx.proboards56.com/index.cgi */
function validate(emailAd) {
var legitRE = /^\w{1,}@\w{1,}\.\w{2,3}(\.\w{2})?$/i;
return legitRE.test(emailAd);
}
var table = document.getElementsByTagName("table");
if(document.postForm && pb_username.match(/Guest/i)) {
for(i=0; i<table.length; i++) {
if(table.item(i).width == "100%" && table.item(i).cellPadding == "4" && table.item(i).innerHTML.match(/Message:/i)) {
var fCell = table.item(i).insertRow(2).insertCell(0);
fCell.className = "windowbg";
var subHeader = document.createElement('font');
subHeader.style.fontSize = '12px';
subHeader.appendChild(document.createTextNode('Email Validation: '));
fCell.appendChild(subHeader);
var sCell = fCell.parentNode.insertCell(1);
sCell.className = "windowbg";
var emailField = document.createElement('input');
emailField.setAttribute("id", "emailInput");
emailField.setAttribute("size", "40");
sCell.appendChild(emailField);
document.postForm.onsubmit = function() {
var valid = validate(document.getElementById('emailInput').value);
if (!valid) {
alert('Invalid E-Mail Address, please enter a valid one. Thank You.');
return false;
}
}
}
}
}
//-->
</script>
Global Footers or Board Footers
<script type="text/javascript">
<!--
/* Force Guest To Submit Email Before Posting
By {XF}Äs$@§sîñ™, www.xf-clan.net/
Keep Header Intact
Code from www.utopiangfx.proboards56.com/index.cgi */
function validate(emailAd) {
var legitRE = /^\w{1,}@\w{1,}\.\w{2,3}(\.\w{2})?$/i;
return legitRE.test(emailAd);
}
var table = document.getElementsByTagName("table");
if(document.postForm && pb_username.match(/Guest/i)) {
for(i=0; i<table.length; i++) {
if(table.item(i).width == "100%" && table.item(i).cellPadding == "4" && table.item(i).innerHTML.match(/Message:/i)) {
var fCell = table.item(i).insertRow(2).insertCell(0);
fCell.className = "windowbg";
var subHeader = document.createElement('font');
subHeader.style.fontSize = '12px';
subHeader.appendChild(document.createTextNode('Email Validation: '));
fCell.appendChild(subHeader);
var sCell = fCell.parentNode.insertCell(1);
sCell.className = "windowbg";
var emailField = document.createElement('input');
emailField.setAttribute("id", "emailInput");
emailField.setAttribute("size", "40");
sCell.appendChild(emailField);
document.postForm.onsubmit = function() {
var valid = validate(document.getElementById('emailInput').value);
if (!valid) {
alert('Invalid E-Mail Address, please enter a valid one. Thank You.');
return false;
}
}
}
}
}
//-->
</script>