[Zope] More Newbie DTML questions

Timothy Grant tjg@avalongroup.net
Tue, 09 Feb 1999 13:22:31 -0800


Hi all!

I'm having a ball playing with this stuff, but I'm still having trouble
understanding some of the finer points of DTML.

First, to test the existence of an object I have found I can do this:

<!--#if ObjectName-->
  <p>Do some stuff</p>
<!--#/if-->

However, if I want to test the existence of two objects, I can do none of
the following:

<!--#if Object1Name or Object2Name-->
<!--#if expr="Object1Name or Object2Name"-->
<!--#if expr="(Object1Name <> '' ) or (Object2Name<>'')"-->

So, other than nesting, is there a way to test the existence of two objects
at one time?

Second, I am working on a page that actually has two forms. the page itself
is the target of the ACTION attribute. The first form displays by default,
when the "continue" button is pressed, the second form is displayed. then a
Calculate button is provided that refreshes the second form with some
calculated data. However, on pressing the Calculate button it appears that
I lose the value of the first ACTION variable, and the second form doesn't
re-display.

Here is the sequence of events

Form One Displays
Press Continue

Form One Displays
Form Two Displays
Press Calculate

Form One Displays

The above is incorrect I want that last section to read:

Form One Displays
Form Two Displays with updated data

Here is the code (highly edited for space):

<FORM ACTION="index_html" METHOD="POST">
  <p>Display Form One</p>

<input type="submit" name="Continue" value="Continue" align="CENTER">
</FORM>

<!--#if Continue-->
  <FORM ACTION="index_html" METHOD="POST">
     <p>Display Form Two</p>
  <input type="submit" name="Calculate" value="Calculate" align="CENTER">
  </FORM>
<!--#/if-->

It appears that Continue is getting reset to no value, but why? I thought
that the values were persistent through the current display cycle.

Thanks for any help that can be provided.



	
-- 
Stand Fast,
	tjg.
===================================
Timothy J. Grant				tjg@avalongroup.net
Avalon Technology Group			www.avalongroup.net
(503) 246-3630 voice                              	
(503) 246-3124 fax			    	

This message may be digitally signed with PGP. A PGP signature 
guarantees that this message really did come from me. For more 
information regarding digital signatures and encryption, please 
contact me.