I'm looking for ideas here...
I'm revisiting the code to the Ubercart checkout form which you can get to through the "work-in-progress" site at http://livetest.ubercart.org. On the checkout page is a Cancel button that takes the user back to the cart view page. The checkout screen naturally has some required fields to collect customer information.
Now, with a Cancel button, you obviously don't care if the customer has filled out all the required fields. I could just do a switch on $form_values['op'] and if I see t('Cancel') then I send them back to the cart screen. However, it has to go through validation before it ever gets to the submit function, so in validation it's throwing up a bunch of errors for those incomplete fields. This just won't do...
So, I used simple Javascript in that form to put ('onclick' => 'window.location = '. base_path() .'"cart"; return false;') in the attributes. That'll kick us out to where we want to go, and in other places also I've used return false; to keep a form from submitting. The question I have is... what in the world can I do for users who aren't using Javascript? (In this situation and others.)
Is there a way to keep the FAPI from trying to validate these required fields? Right now the button type is useless in FAPI, and I'm not sure that '#submit' => FALSE does anything either.
Up for suggestions or questions if I