Validating a Webform with CAPTCHA locally before submitting to an external URL I have the following setup


Drupal 6.x 
Webform 6.x - 3.17
reCAPTCHA 6.x - 1.17


I also have the following custom module

function webform_to_data_repo_form_alter(&amp;$form, &amp;$form_state, $form_id) 
{
if ($form_id == 'webform_client_form_765') 
    {
        $form['#action'] = url('some-external-site.com', array('external' =&gt; true));
        $form['#method'] = 'post';
    }
}


As it is now, the form is able to communicate with the external website. It cannot however validate entered values before it submits. 

This lack of validation is a problem for several reasons because


The CAPTCHA field can be left blank, which defeats its purpose.
Any field that I specifically made mandatory can now be left blank, again defeating its purpose.


I've also read on multiple occasions that once you use $form['#action'], any attempts on validation will cease to work.

I was wondering if there was a way I could prioritize the validation of forms over $form['#action'] and if so, how?

If you could just point me to the right direction, in terms of what my custom module is missing, I'd appreciate it.

Thanks in advance.
If you want to validate form, you need to leave action intact. Then, you can send it's content to external server in it's save handler using it's api or drupal_http_request().

The point is - action tells the browser where to send the data. If you make it send data to external server, your Drupal will never get it, so it will have no opportunity to interact with it. Of course you might try to implement validation in browser too, using JavaScript, but that's unreliable and shouldn't be used as an only way of validation.