1

I have a custom module with a from, form submit handler and for theme hook

In some case I need to create multiple form elements (textfields for example with name like "user_input_1"-"user_input_n")

What I did is change $form array in form theme hook and render new elements. But these elements are missing in the post and form submit processing form (even if shown on a page). I realize what it might be not appropriate way of creating new form elements in theme hook OR maybe there is something(function) what will allow me to properly prepare new form elements in theme hook on a fly.

Or maybe there is another way as I know how many elements do I need in submit processing function which rebuild the form and doing something like $form_state['storage']['wizard_step'] = 'step3' (multi-step form). But I don't know drupal very well, just started..

Stuck and spend few hours trying to find appropriate way of solving this. Any help appreciated. Thanks

0

Answer is simple: form alter hook allows to manage form content on a fly

  • Hello, and welcome on Drupal Answers. May you expand your answer? As it is, it is not much helpful for future readers. – kiamlaluno Sep 25 '12 at 0:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.