[Zope] dtml-in and namespaces

Frank Tegtmeyer ftelist@lightwerk.com
13 Apr 2001 22:52:54 +0200


Hi,

I am mentally blocked now in getting something simple (I assume) to work.

I want to check if all required fields in a form are filled - simply the
presence of data is to be checked for now.

My form processing is included in a <dtml-let> statement that defines
the form variables and the descriptive names. Also the required fields
are defined here.

I want to check the required fields within a <dtml-in> statement. There I
cannot access the fieldnames directly because my test would never fail:

<dtml-let fields="{'m_email':'Email-Adresse',
                   'm_vorname':'Vorname',
                   ...
                   'm_plz':'Postleitzahl'
                   }"
      required="['m_email','m_vorname','m_nachname']"
>
<dtml-if expr="REQUEST.REQUEST_METHOD=='POST'">
  <dtml-call "REQUEST.set('finished','true')">

  <dtml-in required>
       Checking: <dtml-var sequence-item><br>
       <dtml-unless ????????????????>
          <dtml-call "REQUEST.set('finished','false')">
           Missing: <dtml-var sequence-item><br>
       </dtml-unless>
  </dtml-in>

  <dtml-if "REQUEST.get('finished')=='true'">
  ...
</dtml-let>


What has to be used in <dtml-unless>? Is there a better/simpler way to
check the presence of required data?

Form processing is such a basic requirement - ther must be hundreds out
there that can answer my question :)

Many thanks in advance!

Regards, Frank