I'll paste the code below but basically, even though I call form_set_error(), webform is service up the confirmation page. You do see the red error boxes on the confirmation page however ...
Here's my code that should cause webform to redisplay the form along with a form error:
if (preg_match('#'.$ok_string.'#', $html) != 1) {
//Can't find the ok string so the login must have failed. Tell user bad login, try again
form_set_error('submitted][username', t('Couldnt find ' . $ok_string . ' in result'));
form_set_error('submitted][password', t('Unable to log in. Incorrect username or password?'));
curl_close($crl);
return;
}
Comments
Comment #1
Anonymous (not verified) commentedOk, I'm an idiot. Admittedly I'm a tired idiot but still ...
Nothing wrong with webforms. I was porting my form from test to prod and I mistakenly put the validation code in the additional processing text area. Doh!