2

On a website i am currently working on in drupal, on one of the node edit forms, I have a validate function: like so:

$zip_code = $form_state['values']['submitted']['field_address']['postal_code'];
    if(!preg_match("/^([a-ceghj-npr-tv-z]){1}[0-9]{1}[a-ceghj-npr-tv-z]{1}[0-9]{1}[a-ceghj-npr-tv-z]{1}[0-9]{1}$/i",$zip_code)) {
        form_set_error('address', 'Please Enter a valid postal code');
    }

and when this item does not validate on the form, it shows the error, but breaks all the styling for the form, it gets completely broken, items floated everything in the wrong places, wondering if anyone know anything about this ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.