Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by


I am building a Page for my Plugin, which requires taking some inputs from the user and processing them. I copied the example plugin folder, provided along with q2a, and started changing code of that. There is a form on that page, with a textbox, a hidden input element, and a button. All are done by adding arrays with key 'button, 'hidden' and 'fields' (in fact in the example, 'fileds' act as a key for 'textboxes').


I would like to add some other input types, say a Dropdown Menu to the Form. For this I must understand, how (and where) the "form" array is parsed, and which keys (like "button" and "hidden") are interpreted correctly by q2a.

Can anybody tell me, where I can find some documentation for that, or guide me, how to go about doing this?

1 Answer

+2 votes
$form['hidden'] has the hidden variables.  Buttons, dropdowns are just added to $form['fields'] as arrays.  the $field['type'] is the <input type="type"> so it's pretty easy for buttons.  for drop downs, see how the other plugins have done it:

            $formats = qa_list_modules('editor');
            foreach ($formats as $key => $format)
                    $formats[$key] = qa_lang_html('admin/basic_editor');        

            $fields[] = array(
                'label' => 'Signature format',
                'tags' => 'NAME="signatures_format"',
                'type' => 'select',
                'options' => $formats,
                'value' => @$formats[qa_opt('signatures_format')],
Thanks for the Help :) :)