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): Does anyone know what is wrong with this (or with Zope)?
Hi this error occurs if your method doesn't give back any data at all ( I think your called method doesn't return any html). What I did is to put some text around it: <dtml-if "REQUEST.has_key('SUBMIT')"> // this is the submit button of the form dummytext <dtml-call insertNewItem> // this is a ZSQL method </dtml-if> this should it get to work, but perhaps you want to place some real output here or in your ZSQL method yours Philipp Dunkel
Dragomir Denev wrote: 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
-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):
Does anyone know what is wrong with this (or with Zope)?
Try getting rid of any characters or white space before the <html> at the beginning of your page: <dtml-if "REQUEST.has_key('SUBMIT')"><dtml-call insertNewItem></dtml-if><html> ... .. -- Itamar S.T. itamars@ibm.net
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
participants (4)
-
Dragomir Denev -
Itamar Shtull-Trauring -
Michel Pelletier -
Philipp Dunkel