Hi,
I've been displaying a form with automodal with "automodalClose=TRUE". With this, after the form is submitted, the modal closes and the user is redirected according to the $form_state['redirect'] in my submit handler.
I now have a requirement to change this behaviour. On form submission, the modal is to remain open ("automodalClose=FALSE"), and the content from the $form_state['redirect'] page is to display *inside* of the modal (eg: "Thank you, here is a summary of what your submitted").
The problem I'm having is that after form submission, the entire Drupal page content from $form_state['redirect'] displays inside of the modal. By this I mean the header, blocks, footer, etc. I can get around this if I add "automodal=true" to the $form_state['redirect'] url. ie:
change:
$form_state['redirect'] = 'myurl';
to:
$form_state['redirect'] = array('myurl', 'automodal=true');
Is the the only way to do it? I'd prefer not to add automodal-specific stuff to the modules I'm serving up forms from.
Thanks
Ryan
Comments
Comment #1
dsnopekYes, you'll have to do this in a
hook_form_alter()in a custom module.