Form is still trying to do validation I have heavily modified an Ubercart form.

I have tried to remove the initial validation placed on this because I'm using a whole host of different fields.

For some reason, however, the validation is still getting executed.

Why would this be the case? Am I removing all sources of validation correctly?

  array_unshift($form['#submit'], 'client_mod_uc_cart_checkout_handler');
  $form['#validate'][] = 'client_mod_uc_cart_checkout_validate';


I have also tried setting $form['#validate'] to array();

However, upon submission, I get:

First name field is required.
Last name field is required.
Street address field is required.
City field is required.
Postal code field is required.
First name field is required.
Last name field is required.
Street address field is required.
City field is required.
Postal code field is required.


Why would this be the case?
$form['#validate'][] = 'client_mod_uc_cart_checkout_validate';


Will only append your function to the list of functions in the validation array.

I'm fairly certain using = array() won't work because that's how you define an array, not how you empty one.

Modified answer from Stack Overflow:


  Use unset, if you need the array later on just instantiate it again.

unset($form['#validate']);
$form['#validate'] = array();