display Plone FormGen in popup

1.1k views Asked by At

I have created a form using PloneFormGen tool. Now I would like to display this form in a popup in a manner similar to the login form is displayed on click of a button. I've looked into the jquery tools module that give me the option to load a url/ajax forms in a popup. I tried to load the url in iframe but it displays the entire page in the pop-up. I only need the form section to be displayed. Do I need to customize the plone formgen form in some way so that the jquery tools understands it? Or do I need to create the forms in some other manner? The point is I need the mailer functionality also once my form is successfully submited so Plone FormGen fits the requirement in this case. Any guidance/pointers on this would be helpful. Do suggest some pointers.

2

There are 2 answers

4
SteveM On

Take a look at the way Plone sets up its own popup forms in plone_ecmascript/popupforms.js. It'll show you several really working examples of how to do popup forms. For example, the contact form setup:

// contact form
$('#siteaction-contact a').prepOverlay(
    {
        subtype: 'ajax',
        filter: common_content_filter,
        formselector: 'form[name="feedback_form"]',
        noform: function(el) {return $.plonepopups.noformerrorshow(el, 'close');}
    }
);

PFG forms are no different. Note the "filter" specification: that's what makes sure you don't show more of the page than you wish. That kind of filtering is possible in an AJAX popup, but not an iframe.

Full details at http://pypi.python.org/pypi/plone.app.jquerytools/1.4b1

0
Davi Lima On

You might take a look at Popup Forms for Plone: http://plone.org/products/pipbox.portlet.popform