I have a form that uses POST to transfer it's output because there is a lot of text and because I don't want it exposed on the command line. The form gets processed and then wants to return the same material, slightly modified, to the original form to repopulate. To do this I generally redirect to the original form with the variables appened as quote_plus() quoted name/value pairs in the usual GET format. Is there some way to use POST in this context? If it's significant, the form is embeded in a frameset. -dra
If I understand correctly, you want a form that updates information and returns itself with updated data & allow multiple updates using POST. Don't bother with redirection... just have the form call itself. Put a hidden input in the form with a name like "updated" and check for its existence. If it's in the request, use dtml-call to process any changes that have been submitted. Call that processing method at the very top of the form and everything else should fall into place... your fields should find themselves populated with fresh data without any extra effort. HTH, Dylan On Fri, 2003-04-04 at 14:46, Dennis Allison wrote:
I have a form that uses POST to transfer it's output because there is a lot of text and because I don't want it exposed on the command line.
The form gets processed and then wants to return the same material, slightly modified, to the original form to repopulate. To do this I generally redirect to the original form with the variables appened as quote_plus() quoted name/value pairs in the usual GET format.
Is there some way to use POST in this context?
If it's significant, the form is embeded in a frameset.
-dra
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Is there a way, or more accurately, has anyone done something like this w/o making the form call it-self? I am asking because I am currently in a bit of a nightmare having to maintain other peoples code that uses forms that call themselves recursively, and I am trying to develop some coding guidelines for my projects that will ban the usage of forms that call themselves. I know, I know, they can be damned handy at times but, as I said, the maintenance burden can be a pretty masive, especially when you try to debug/modify them. Or is there no other way? Thanks, /dario ----- Original Message ----- From: "Dylan Reinhardt" Sent: Saturday, April 05, 2003 2:33 AM Subject: Re: [Zope] redirects & POST
If I understand correctly, you want a form that updates information and returns itself with updated data & allow multiple updates using POST.
Don't bother with redirection... just have the form call itself. Put a hidden input in the form with a name like "updated" and check for its existence. If it's in the request, use dtml-call to process any changes that have been submitted.
Call that processing method at the very top of the form and everything else should fall into place... your fields should find themselves populated with fresh data without any extra effort.
HTH,
Dylan
Dario Lopez-Kästen wrote:
Is there a way, or more accurately, has anyone done something like this w/o making the form call it-self?
I am asking because I am currently in a bit of a nightmare having to maintain other peoples code that uses forms that call themselves recursively, and I am trying to develop some coding guidelines for my projects that will ban the usage of forms that call themselves.
I know, I know, they can be damned handy at times but, as I said, the maintenance burden can be a pretty masive, especially when you try to debug/modify them.
Or is there no other way?
Thanks,
/dario
What I do is also using a python script as an intermediary for forms, no matter what they do. The form is written with the possibility of prepulating the values (i.e. <input type=text name=client_name value=<dtml-var name html_quote missing>>) I then POST to the python script, and the python script returns the form by calling it (not a redirect), passing in the filled out variables (or just the REQUEST), and maybe a variable which tells the form a message to display (i.e. "please fill out the missing values"). In your case, since your two forms seem to be slightly different, maybe write the common code in its own method. cheers, oliver
Dennis Allison wrote at 2003-4-4 14:46 -0800:
I have a form that uses POST to transfer it's output because there is a lot of text and because I don't want it exposed on the command line.
The form gets processed and then wants to return the same material, slightly modified, to the original form to repopulate. To do this I generally redirect to the original form with the variables appened as quote_plus() quoted name/value pairs in the usual GET format.
Is there some way to use POST in this context?
HTTP 1.1 forbids (the HTTP client) to redirect a POST request without explicit user interaction. If this does not disturb you (it probably will) *and* you are sure that all your HTTP clients are 1.1 compatible, then you can use the special HTTP POST redirect (introduced in HTTP 1.1). Others already told you to simply call the form. This works fine when the base url is the same. Otherwise, my "emulatedRedirect" might be helpful <http://www.dieter.handshake.de/pyprojects/zope> Dieter
participants (5)
-
Dario Lopez-Kästen -
Dennis Allison -
Dieter Maurer -
Dylan Reinhardt -
Oliver Bleutgen