Passing Variables Through Multiple Forms
Hi; What is the best way to pass variables defined in one form to a second form? Is there a tutorial available (couldn't find a HOW-TO). TIA, BenO
Use Formulator, read the how-to, join the mail-list, ask some more. ;)
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Ben Ocean Sent: Monday, October 29, 2001 7:13 PM To: zope@zope.org Subject: [Zope] Passing Variables Through Multiple Forms
Hi; What is the best way to pass variables defined in one form to a second form? Is there a tutorial available (couldn't find a HOW-TO). TIA, BenO
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Mon, Oct 29, 2001 at 07:25:51PM -0500, Trevor Toenjes wrote:
Use Formulator, read the how-to, join the mail-list, ask some more. ;)
Or, if you don't need Formulator: http://www.zope.org/SiteIndex/search?text_content=wizard http://www.zope.org/Members/jspisak/wizard_keys -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Ben Ocean wrote:
Hi; What is the best way to pass variables defined in one form to a second form? Is there a tutorial available (couldn't find a HOW-TO).
When the variable(s) should cross just one form, and there are just a few variables, I do this: <dtml-call "REQUEST.set('name',name)"> <dtml-call "REQUEST.set('address',address)"> The code above must be written in the second page, which received the name and address from a form in the first page, and which must provide this data to the third page. When the variable(s) should cross many pages, when there are many variables, or when you accumulate variables as you take the user through multiple pages, I use CoreSessionTracking. Example: First page collects name and address using a html form. Second page contains this code: <dtml-call "save_data(REQUEST.form)"> save_data is a Python Script, parameter is form_data: data=context.SDM.getSessionData() data.set('form',form_data) That is all you need to save data. To retrieve data: <dtml-let data="SDM.getSessionData(create=0)['form']"> <dtml-var "data.get('name')"><br> <dtml-var "data.get('adress')"><br> </dtml-let> The examples above are probably a tad clumsy (non-elegant). But they work just fine. Comments welcome! -- Milos Prudek
What is the best way to pass variables defined in one form to a second form? Is there a tutorial available (couldn't find a HOW-TO).
When the variable(s) should cross just one form, and there are just a few variables, I do this: <dtml-call "REQUEST.set('name',name)"> <dtml-call "REQUEST.set('address',address)"> The code above must be written in the second page, which received the name and address from a form in the first page, and which must provide this data to the third page.
Ouch, I need to retract the above incorrect claims :-( REQUEST.set modifies the current request. It is nothing more than a singleton <dtml-let>. It sets variables within the page itself, and it has no influence on next pages. To carry variables from one page to another, you need to use CoreSessionTracking product or other session tracking products. You can also choose to use hidden form variables in cases where it does not present a security risk. -- Milos Prudek
there is a recipe for doing this on zopelabs. http://www.zopelabs.com/cookbook/991281006 On Mon, 2001-10-29 at 19:13, Ben Ocean wrote:
Hi; What is the best way to pass variables defined in one form to a second form? Is there a tutorial available (couldn't find a HOW-TO). TIA, BenO
participants (5)
-
Ben Ocean -
M. Adam Kendall -
Mike Renfro -
Milos Prudek -
Trevor Toenjes