[Zope] Trouble with forms

Stephan Richter srichter@cbu.edu
Sun, 26 Mar 2000 15:08:00 -0600


>
>         What I'm trying to do is pull the 'date_mm' (along with the other
>         two fields, 'date_yy' and 'date_dd') into the namespace area so I
>         can do something like:
>
>   <input type="hidden" name="event.date" value= \
                                                        |------> Do not use 
a dot, it will cause you grief.

>     "<dtml-var var_yy>-<dtml-var var-mm>-<dtml-var var-dd>">
>
>         I would expect that I can use something like:
>
>   <dtml-call "REQUEST.set('var_mm', 'date_mm')">
>
>         However, that doesn't work like I'd hoped.

Your question is not quiet clear, but I will make some assumptions and then 
try to answer it:

I assume you want to do that all in the same file, without sending a form. 
In this case what you want to do is not possible, because you ask the 
server to know something which does not exist yet.

A form is created in the moment the user submits it. So here is how you do it:

FILE: someForm

...
<form action="someAction">
   <select name="date_dd">
      <option value="01">01
      <option value="02">02
      ...
   </select>
   <select name="date_mm">
      <option value="01">January
      <option value="02">February
      ...
   </select>
   <select name="date_yy">
      <option value="1999">1999
      <option value="2000">2000
      ...
   </select>
   <input type="submit">
</form>
...

FILE: someAction

...
<dtml-call "REQUEST.set('eventDate' , date_mm+'/'+date_dd+'/'+date_yy)">
...

So you combine your date AFTER the form is transmitted. I cannot think 
about a case, where you need it differently. If you have one, you should 
revise your design, since weird syntax is mostly due to bad design.

Regards,
Stephan

--
Stephan Richter - (901) 573-3308 - srichter@cbu.edu
CBU - Physics & Chemistry; Framework Web - Web Design & Development
PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391