views:

819

answers:

1

How do I have a submit form close when you hit save and then force the next page to reload and update with the data from the form? This is drupal 6.

+1  A: 

You can set the $form['#redirect'] = 'somepath'; in the submit function. Then, it'll redirect to that location when you're done.

Check out the documentation at http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6#redirect.

John Fiala
Yes this works, as long as this person understands that they will have to store the data from the first form in the database, and pass an argument along the path so that the new page "knows" what data to present.
David Wees
Well, that's true. But if he's not saving his results in the database, he should say so, IMHO. The only forms in Drupal which don't store their results in the db usually put the form data into the querystring.
John Fiala

related questions