Last week I came across a use case for someone wanting to use our Plone based service to make a form go to a different url, in this case just posting your name to an online testing service (UsolveIt) for a specific test.
Not having tested much with PloneFormGen, we thought this could be interesting, so we gave it a shot. We already knew it was a great package, but I’d still like to say thanks to the brilliant people at OneNorthWest for providing yet another solution for our use case without us having to ask for it or start programming. The PloneFormGen package has not just one, but several ways to override a form action.
Here I’ll just write out our specific use case, but more info on the great possibilities of this package can be found at:
- http://plone.org/products/ploneformgen
- http://onenw.org/support/plone-form-gen/plone-form-gen
- http://plone.org/products/ploneformgen/documentation
- http://learnplone.org/documentation/phc_search?SearchableText=ploneformgen&phc_selection=all
First step is to make a form with only one field. Makes ure you have full (Plone) manager rights before you start.
- Add a form folder and remove all fiels but the subject.
- Rename the subject to something like Name
- Our form then looks like this:

- Make sure you have the usolveit test already set up and have the url, including test-id ready
- Edit the form folder and go to the tab Overrides
- The full succes action should look something like:
redirect_to:python:'http://www.usolvit.be/servlet/toets.servlets.PdfRegistratie?
domein=WISK&toets=A000000A0000&naamStudent='+request.form['naam']
- When the form is finished, you can click the Start test button and the browser will open a new tab with the test:

0 Response to “Changing the form action in PloneFormGen”