Dragomir Denev wrote:
Please help.
On the top of 'index_html' I have:
<dtml-if "REQUEST.has_key('SUBMIT')"> // this is the submit button of the form // the action of the form is 'index_html' itself <dtml-call insertNewItem> // this is a ZSQL method </dtml-if> -here is the form-
The point is that I want the method to be executed only when the form is submitted. When first displayed nothing unusual happens (the REQUEST doesn't have 'SUBMIT'). But when I submit the form than this is what I get:
Error Type: ValueError Error Value: Invalid Header (0):
Zope doesn't like it if there is no html tags before the DTML begins. I think this is fixed, what version are you running? There is much easier and more powerful way to do what you want. In your calling form, name the buttons: <input type="submit" name="clicked_ok:method" value=" Ok "> <input type="submit" name="clicked_cancel:method" value=" Cancel "> And create two methods, one named 'clicked_ok' and the other named 'clicked_cancel'. This allows trivial creation of web 'dialog boxes' or methods that are triggered on certain submit buttons. More documentation is here http://classic.zope.org:8080/Documentation/Reference/ORB which is admitedly pretty hard to find. Rooting through the documentation section of Zope.org can turn up alot of good stuff. -Michel