Hi! I've got a webform on a page-template. When the user clicks on the submit button a python-script is called. After executing the script I want to refresh the page-template with the form on it. I now use context.REQUEST.RESPONSE.redirect('name/of/pt') at the end Of the script. But (for example) when I call the script from another page-template I also get redirected to the first pt... I know, I could send a variable with the script-call and redirect to the right pt, but I was wondering if there is another (better) way of doeing this. For example if I could send a 'refresh' command to the browser! Thanx for any help! Greetings, Marco
context.REQUEST.RESPONSE.redirect(context.absolute_url_path()) ? On Wed, 2004-04-21 at 15:06, Marco Mans wrote:
I now use context.REQUEST.RESPONSE.redirect('name/of/pt') at the end Of the script. But (for example) when I call the script from another page-template I also get redirected to the first pt...
Marco Mans wrote:
Hi!
I've got a webform on a page-template. When the user clicks on the submit button a python-script is called. After executing the script I want to refresh the page-template with the form on it.
I now use context.REQUEST.RESPONSE.redirect('name/of/pt') at the end Of the script. But (for example) when I call the script from another page-template I also get redirected to the first pt...
I know, I could send a variable with the script-call and redirect to the right pt, but I was wondering if there is another (better) way of doeing this. For example if I could send a 'refresh' command to the browser!
I use special "handler" to process form actions. We need Page Template file (index.pt) and Python Script (formHandler). index.pt looks like this: <html> ... <tal:block replace="structure here/formHandler" /> <form action="" method="post"> ... <input type="submit" name="action1" value=" Action1 " /> <input type="submit" name="action2" value=" Action2 " /> </form> </html> formHandler at least contains handlers for each action: ... if hasattr(request, 'action1'): do_something() elif hasattr(request, 'action2'): call_other_script() It's basis. I made very complex things around this: set/change request variables, validation, error messages, etc. Cheers, Vital Lobachevsky
participants (3)
-
Marco Mans -
Michael Joseph -
Vital Lobachevsky