I have looked through some of the older posts and still a little confused with what is happening. I have a shipping form that DOES NOT allow PO Boxes so I am trying to find a validator to look through and make sure that input field doesn't have PO in it. I am making sure every field is filled out with this code but wondering how I could incorporate in the PO box validation with it. Note: this is a separate file from my actual form
$( document ).ready(
function()
{
$( '#shipping' ).submit(
function()
{
var required_fields = new Array(
'name',
'service',
'company',
'contact',
'street',
'city',
'state',
'zip',
'projectnum'
);
for( j in required_fields )
{
var theRequiredField = required_fields[j]
var inputField = $( '[name="' + theRequiredField + '"]' )
if( inputField.val() == '' )
{
alert( "The '" + theRequiredField + "' field is required." );
inputField.focus();
return false;
}
}
} // function
) // submit
}
);