Can I use a form in a dashboard widget?

There are two options to use forms in a dashboard widget:

  1. Use the parameter control_callback. See the Codex

    wp_add_dashboard_widget(
        'my_id',            // $widget_id 
        'my_name',          // $widget_name 
        'my_render_widget', // $callback 
        'my_control'        // $control_callback
    );
    function my_control()
    {
        // print some form elements, WordPress will handle the <form> tag.
    }
    
  2. If you want to use a form in the main display handler, set the form action to admin-post.php and add a callback function for a custom action there. Example. When you are done processing the form redirect back to the dashboard.