I have this script working and now i just need the alert to pop up when the field is in PHP.
But when i put it in echo"" the onBlur event wont work.
function validate() {
var valStreet = new RegExp("[pP]{1}[.]*[oO]{1}[.]*[ ]*[bB]{1}[oO]{1}[xX]{1}"); //Anything with "PO BOX" alerted
if (form.Street.value.match(valStreet) != null) {
alert("No P O Box Allowed in Shipping Address.");
}
}
</script>
</head>
<body><form name="test">
Street: <input type="text" name="street" value="" onBlur="validate();"><br>
<input type="button" name="test" value="test">
</form>
<?PHP echo"<input type='text' name='street' onBlur=\"validate();\" value=$street >"; ?>
//Something wrong with the onBlur Code!!!!
What is the correct way to get onBlur to work when in PHP?????