[Zope] Using batch variables in expressions

Ben Glazer glazer@scicomp.com
Tue, 26 Oct 1999 17:14:08 -0500


I want to verify that certain fields in a form have been entered.  Here's a
code snippet I've tried to use:

<dtml-let required="('first', 'last', 'email')">
	<dtml-in required>
		<dtml-if expr="REQUEST.form[sequence-item]">
		   <dtml-var sequence-item> exists
		</dtml-if>
	</dtml-in>
</dtml-let>


Naturally, I get an error when this is executed, since Python interprets
"sequence-item" in the dtml-if as subtracting item from sequence.  I thought
<dtml-var sequence-item> might work, but apparently that sort of thing is
not allowed in an expression.

Is there a way to access the value of sequence-item in an expression?  If
not, how could I go about verifying that form fields are entered correctly?

As a side note, is there any good reason that sequence-item isn't spelled
sequence_item?  Just curious...


Thanks,
Ben