[Zope] Sorting and accessing elements in the

Max Møller Rasmussen maxm@normik.dk
Tue, 3 Oct 2000 17:05:00 +0200


I am making a mailer zClass where it will only be nessecary to make the form
fields with the values you want to send, then the zClass will give you a
reply on the webpage and send a nicely formatted e-mail.

The problem is that the form elements are unknown but they need to be set up
in predictable order to format the output automatically.

To do this I need the form values in a sorted order. I can then give the
form fields names like this:

<input type=text name="1) First Name" value="Max M">
<input type=text name="2) Last Name" value ="Rasmussen">

------------------------------------

Then the mail can be automatically formatted like this:

1) First Name
Max M

2) Last Name
Rasmussen

etc....

------------------------------------

I have tried to use the sequence-item as a key in REQUEST.form, but it
doesn't work like I want it to.

---------------------------------

<dtml-var standard_html_header>

<dtml-var webReply><p>
<dtml-call "REQUEST.set('keys', REQUEST.form.keys())">
<dtml-call "keys.sort()">

<dtml-in keys>
    <dtml-var sequence-item>:<br>
    <dtml-var "REQUEST.form[sequence-item]"><p>  <---- THIS IS WHAT DOESNT
WORK
</dtml-in>

<dtml-var standard_html_footer>

---------------------------------

Regards Max M