More Newbie DTML questions
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.
On 9 Feb 99, at 13:22, Timothy Grant wrote:
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<>'')"-->
try <!--#if expr="_.has_key('Object1Name') or _.has_key('Object2Name')"--> For this:
<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">
<input type=hidden name="Continue" value="<--#var Continue-->">
</FORM> <!--#/if-->
I think you need to add the hidden var shown above. Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com ICQ: 14856937 We must come down from our heights, and leave our straight paths, for the byways and low places of life, if we would learn truths by strong contrasts; and in hovels, in forecastles, and among our own outcasts in foreign lands, see what has been wrought upon our fellow-creatures by accident, hardship, or vice. - Richard Henry Dana, Jr. 1836
participants (2)
-
Brad Clements -
Timothy Grant