I have an form in a block with ajax submission. The block view code calls
drupal_get_form, adds some other info, uses a custom theme tpl to create the block.
I want to replace the form in the block with a thank you message after successful submission.
AJAX works: The ajax on the submit element of the form means that a custom ajax callback can replace the entire form with another themed chunk, passing in the form values received by the form so they can be merged in the thank you template. This works well because the ajax function has access to the form_state.
But what if AJAX is unavailable on the client? Then the normal form submit happens and the block view function just gets a blank form.
So how can my block view function get hold of the submitted values to feed them into the thank you template?
Edit: messy work-arounds
I could just access
$_POSTbut that's nasty and unvalidated! yuk
In the submit handler I can copy the
$form_state['values']variable to a superglobal, and check for that.