Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
383 views
in Plugins by
edited by

I am continuing to develop the new best-users-plugin and extend it as some other users asked for, providing a page where you can choose different months.

Now I am creating the page where you can pick a month and it queries the database.

However: How can I check if something has been posted?

In process_request($request) I tried:
if(!empty( $qa_content['form']['ok'] )) { ... }

without success.

1 Answer

0 votes
by

this is it:

            // we received post data
            if( qa_post_text('request') ) { ... }
 

PS: In your custom form you need to define 'request', e.g.

            $qa_content['form']=array(
                'tags' => 'METHOD="POST" ACTION="'.qa_self_html().'"',
                
                'style' => 'wide',
                
                'ok' => qa_post_text('okthen') ? 'Submit successful! Value is: '.qa_post_text('request') : null,
                
                'fields' => array(
                    'request' => array(
                        'id' => 'month_dropdown',
                        'label' => "choose stuff:",
                        'tags' => 'NAME="request"',
                        'type' => 'select',
                        'options' => $dropdown_options,
                        'value' => '2012-05-01', // qa_html($request),
                        //'error' => qa_html('Another error'),
                    ),
                ),
 

...