A client wants to have a search form where the results page effectively has two copies of the form. Originally I had one form with a bunch of buttons - "search", "export", etc. They didn't like that you could modify the form and then hit e.g "export" and have it use those updated values, they want to have it so that you have to explicitly hit "search" and get a visual indication of the results first. I proposed an AJAX solution where it would update automatically, and I could have just one form, but that was passed on. Essentially I am looking at needing to have the same form printed twice, albeit with different buttons and some css hiding. The first would have a set of buttons related to processing on those results in some way e.g. export with the search fields hidden. The second would have the regular fields and for the buttons it only displays the "search" button.
So what I'm looking at is having my template do
<metal:block use-macro="context/@@ploneform-macros/titlelessform"> twice and fill-slot "actions" because the buttons need to be different for each form. Also, I need to manipulate the form in the view class so that the ids are unique in order to get valid HTML and so js/DOM-manipulation works. This seems to work but it feels hacky to say the least. Is there a better way to accomplish this?