<html>
<head>
<title>bogus_36.php</title>
<script language='JavaScript'>
<!--
var object;
function isTollFree(e, object) {
var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
var status = charCode;
if (!charCode) return false;
// alert('charCode: ' + charCode);
var realChar = String.fromCharCode(charCode);
var mask = /^((800|888))\-[123456789][0123456789]{2}\-[0123456789]{4}$/;
var fake1 = '800-499-7123';
var fake2 = '888-499-7123';
if (charCode == 189) return false; // no need for manual insertion since we have look-ahead
if (charCode == 13) return false; // may not want to do this with force-filling of fields
if (charCode == 8) return true; // this lets them change the last character if need be
if (charCode == 9) return true; // tab to next field
if (object) {
var thisForm = object.form.name;
var thisName = object.name;
var thisEntry = eval('document.' + thisForm + '.' + thisName + '.value');
thisEntry += realChar;
dummy1 = thisEntry + fake1.substring(thisEntry.length, fake1.length + 1);
dummy2 = thisEntry + fake2.substring(thisEntry.length, fake2.length + 1);
if (dummy1.search(mask) != -1 || dummy2.search(mask) != -1) {
// look-ahead insertion of dashes (i.e; stuffing the buffer)
if (fake1.charAt(thisEntry.length) == '-') {
var cmd = 'document.' + thisForm + '.' + thisName + '.value += \'' + realChar + '-\'';
eval(cmd);
return false;
}
return true;
}
alert('the last character did not conform to an ANI numbering format [###-###-####]');
return false;
}
}
var object;
function isPhone(e, object) {
var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
var status = charCode;
if (!charCode) return false;
// alert('charCode: ' + charCode);
var realChar = String.fromCharCode(charCode);
var mask = /^[23456789][0123456789]{2}\-[123456789][0123456789]{2}\-[0123456789]{4}$/;
var fake = '303-499-7123';
if (charCode == 189) return false; // no need for manual insertion since we have look-ahead
if (charCode == 13) return false; // may not want to do this with force-filling of fields
if (charCode == 8) return true; // this lets them change the last character if need be
if (charCode == 9) return true; // tab to next field
if (object) {
var thisForm = object.form.name;
var thisName = object.name;
var thisEntry = eval('document.' + thisForm + '.' + thisName + '.value');
thisEntry += realChar;
dummy = thisEntry + fake.substring(thisEntry.length, fake.length + 1);
if (dummy.search(mask) != -1) {
// look-ahead insertion of dashes (i.e; stuffing the buffer)
if (fake.charAt(thisEntry.length) == '-') {
var cmd = 'document.' + thisForm + '.' + thisName + '.value += \'' + realChar + '-\'';
eval(cmd);
return false;
}
return true;
}
alert('the last character did not conform to an ANI numbering format [###-###-####]');
return false;
}
}
// -->
</script>
</head>
<body>
<form name='myform' onSubmit=''>
<table cellspacing=3 cellpadding=0 align='center' valign='top'>
<tr>
<td align='right' valign='middle'><font face='arial' size='-2'>my_phone:</font></td>
<td align='left' valign='middle'>
<input name='my_phone'
onKeyDown='return isPhone(event, this)'
style='font-family: arial; font-size: 7pt; font-weight: light; font-color: red; text-indent: 1px'
size=13>
</td>
</tr>
<tr>
<td align='right' valign='middle'><font face='arial' size='-2'>my_toll_free:</font></td>
<td align='left' valign='middle'>
<input name='my_toll_free'
onKeyDown='return isTollFree(event, this)'
style='font-family: arial; font-size: 7pt; font-weight: light; font-color: red; text-indent: 1px'
size=13>
</td>
</tr>
</table>
</form>
</body>
</html>