[development] How to pass form values to page that actually does something.

Peter Droogmans Peter at attiks.com
Tue May 11 07:23:23 UTC 2010


We solved this problem by using tablewizard (tw) to make the data available to Drupal and views. If you combine it with bef and views_savedsearches you can accomplish the same.


Best regards,
Peter Droogmans
Attiks
Ketsstraat 94
2140 Borgerhout
Belgium
32 3 288 61 17
32 497 44 44 77



-----Original Message-----
From: development-bounces at drupal.org [mailto:development-bounces at drupal.org] On Behalf Of Bayne, Sam
Sent: maandag 10 mei 2010 6:37 PM
To: development at drupal.org
Subject: [development] How to pass form values to page that actually does something.

I'm quite frustrated with the Form API right now, so please forgive my tone.

I've got a form that has a bunch of inputs, all of them multiselects, that allow the user to choose what classes to see in our schedule.
(our class schedule is in an external database).  I've got a bunch of code in the form_submit function that builds a very elaborate sql query to get the list of requested classes.

Unfortunately, the form_submit function is not actually permitted to display anything except through drupal_set_message().

So I have to either pass my complicated sql query, or all the contents of the form fields to some other page through $form_state['redirect'].

How do I do that without shoving it all into the querystring?

Right now, I'm looking at the performance issues of:

A: storing the query as a string in the database with a query_id, then sending a query_id in the redirect,
B: storing the result of the query in the database with a result_id, then sending a result_id in the redirect.

Is there some other way to accomplish what I want?

p.s. I've looked at the search module, it basically shoves the form input into the querystring of the redirect. That'll work for a single input, but multiple array inputs will be a huge pain.





More information about the development mailing list