Case: insert/embed a form within another form, while maintaining the original
<form> markup in the embedded output. In this case, it's a Views Bulk Operations form with Exposed Form Filters embedded within a Node edit form.
Issue: when embedded, everything looks good on the surface and the view display the form and all its elements. However, when examining the Views Exposed Form rendered output, the Exposed Filter is stripped of it's
<form> markup. However, when I add the block to a region in the standard way on the same page as the Node edit form, the Views Exposed Form output contains the
<form> markup and the Filter works fine.
Notes: the Views Content of the VBO form is not affected and has its
<form> markup intact within the Node edit form. Only the Exposed Form Filter within the same views display is stripped of it's
<form>. Also, using a pager in the views display and with Use Ajax set to Yes, if I click to the next page of the views results, the Ajax refreshed form contains the correct
<form> markup for the Views Exposed Form and the filter works from then on.
Things I've tried:
setting the exposed form to appear in a block and then embedding the exposed form block separately using module_invoke('views', 'block', 'view', '-exp-instructor_select-page_1').
embedding the view using views_embed_view('VIEW-NAME', 'VIEW-DISPLAY') - whether the VIEW-DISPLAY was 'default', 'page_1', or 'block_1' - same issue.
embedding a Views block display using module_invoke('views', 'block', 'view', 'VIEWS-DISPLAY-block_1');
inserting the form directly using drupal_build_form($form_id, &$form_state) (Views' replacement for drupal_get_form)
hard-coding the markup within a custom views exposed filter template:
<form id="views-exposed-form-VIEWS-DISPLAY" method="get" accept-charset="UTF-8" action="/URL" class="views-processed">VIEWS EXPOSED FORM TEMPLATE CODE
<input type="hidden" value="instructor_select" name="view_name"><input type="hidden" value="block_1" name="view_display_id"><input type="hidden" value="" name="view_args"><input type="hidden" value="user/1/edit/studio" name="view_path"><input type="hidden" value="URL-PATH" name="view_base_path"><input type="hidden" value="VIEWS-DISPLAY" name="view_dom_id"><input type="hidden" value="0" name="pager_element"></form>
I'm sure I'm missing a few of the other ways I've tried to work this out, but this should be enough to serve as examples of things of tried.
No matter how the form is embedded in the Node edit form, the Views Exposed Filter doesn't work since the
<form> element is missing, the AJAX however works with the rest of the VBO form and upon using the pager and AJAX refreshing the Views form display, the Exposed Form Filter markup is rendered correctly and the filter works.
At this point I'm out of ideas. I would really appreciate some pointers or code samples on how to attempt this.
Thanks in advance.