Hi,
I have an Alert box which pops up when a customer enters in "po box" in IE7 it doesn't let the user continue after entering "po box" in the field but in Firefox after Alerting it still lets the customer continue.
How can i make it so that on all browsers the customer cannot continue unless they remove "po box" from the field???
Javascript:
function validate() {
var doc = document.create_account;
var valstreet_address = new RegExp("[pP]{1}[.]*[oO]{1}[.]*[ ]*[bB]{1}[oO]{1}[xX]{1}");
if (doc.street_address.value.match(valstreet_address) != null) {
alert("No P O Box Allowed in Delivery Address.");
doc.street_address.focus();
}
}
<?PHP echo"<input type=text name=street_address onblur=\"validate();\" value='$street_address'>"; ?>
PROBLEM 2:
How can i get my drop down menu to populate once the user has enter a 3 digit number in postcode which starts with an 8 only?
At the moment it populates the drop down after the 4th number is enetered but if it's a 3 digit postcode starting with 8, the user needs to manualy click the Load Suburbs button.
<?php echo "<input name='postcode' type=text onkeyup=\"if(this.value.length>3)reload(this.form);else return false;\" value=$postcode>"; ?>
I want it to also reload only if a 3 digit number is entered which begins with 8.