Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Something I just realized I don't understand about the forms API:

I'm putting up a form where I have to do a bit of work to figure out exactly what the form's contents should be (e.g., which of a possible set of radio buttons should, in this specific situation, really be there). This work is getting done not only on the first pass through the _form() handler -- the one that produces the form presented to the user -- but also the other calls to _form() that happen along the way to the form finally being submitted.

So: If I can find some way (down in $form_state, I presume) to figure out which pass through the handler I'm on, can I safely skip these form generation calls? Or will omitting them screw up something else? A few simple attempts (e.g., checking the contents of $form_state['values']) haven't worked; are these multiple calls just part of the price of the forms API? They're not that big a deal, but every little bit helps...

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.