[Zope] Simple form problem (again)

Geoff Gardiner ggardiner@synomics.com
Thu, 27 Apr 2000 13:45:00 +0100


Sorry to return to the simple multi-button problem, sorry, sorry; but I just
can't get it to work in Zope.

I have a table whose rows I want to copy or edit or delete, so I put 3
buttons on each row. The buttons are all of type 'submit', the 3 have names
'copy', 'edit' and 'del', and all the buttons on a row have a unique value
that references the row.

However, when any button is pressed, ALL the buttons are valid according to
the REQUEST, in three dictionaries 'copy', 'edit' and 'del' (and there's no
'submit' entry). And I can't get hold of the unique value of any of them - I
just get the text I'm displaying on the button, which is non-unique. All
details below.

This seems to contravene the HTML4 spec, and what's been discussed here
recently, since I would expect a single valid name / value pair. So I
suppose I'm doing something wrong again, but I would very much like somebody
to point me in the right direction.

Thank you in advance,
Geoff Gardiner


Platform
--------
Win NT4 SP5 IE5 Zope 2.1.6

DTML source
-----------
<form action="testform" method="POST">
...
<dtml-with "Data">
  <dtml-in "objectValues()" sort=item_lc>
    <dtml-if "item<>''">
    <tr>
      <td><dtml-var "item"></td>
      <td><dtml-var "definition"></td>
      <td><dtml-var "notes"></td>
      <td align="center"><BUTTON name="copy" value="<dtml-var id>"
type="submit">Copy</BUTTON></td>
      <td align="center"><BUTTON name="edit" value="<dtml-var id>"
type="submit">Edit</BUTTON></td>
      <td align="center"><BUTTON name="del" value="<dtml-var id>"
type="submit">Del</BUTTON></td>
    </tr>
    </dtml-if>
  </dtml-in>
</dtml-with>
...
</form>

Renders as
----------
Item   Definition    Notes         Copy   Edit   Del
A1     A defintion2 Notes2 of it  <Copy> <Edit> <Del>
B2     A defi1ntion Notes o1f it  <Copy> <Edit> <Del>
C3     Another def  Notes of it   <Copy> <Edit> <Del>

Source viewed as
----------------
...
    <tr>
      <td>B2</td>
      <td>A defi1ntion</td>
      <td>Notes o1f it</td>
      <td align="center"><BUTTON name="copy" value="abcdef1"
type="submit">Copy</BUTTON></td>
      <td align="center"><BUTTON name="edit" value="abcdef1"
type="submit">Edit</BUTTON></td>
      <td align="center"><BUTTON name="del" value="abcdef1"
type="submit">Del</BUTTON></td>
    </tr>
...

Posted on testform, using <dtml-var REQUEST> shows REQUEST.form as
------------------------------------------------------------------
form
del ['Del', 'Del', 'Del']
copy ['Copy', 'Copy', 'Copy']
edit ['Edit', 'Edit', 'Edit']