Drupal form being rendered before submit action

Posted by alxp on Stack Overflow See other posts from Stack Overflow or by alxp
Published on 2009-01-22T17:28:29Z Indexed on 2010/05/27 14:31 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

I have a Drupal module page where I am populating a form with a drop-down that contains a list of available parts of a set of files that the user can upload. Once the user uploads a file of a certain type, it removes that option from the list, and when all the available files are uploaded the form will not be rendered.

The problem is that Drupal is drawing the form before it carries out the submit action, so it appears to the user that the operation didn't work until they reload the page.

What is the common way to deal with this? Setting form_state['redirect'] to go to the page doesn't seem to work.

© Stack Overflow or respective owner

Related posts about php

Related posts about drupal