[Zope-dev] submitting queies

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Mon, 24 Jan 2000 16:49:34 +1100


>>> Stephan Richter wrote
> I have the following problem:
> <form  action=".">
>     <input name="add:method" type="image" src="Images/add" >
>     <input name="index_html:method" type="submit" value="Cancel">
> </form>
> 
> does not work. Therefore the :method attribute works only for submit types. Is
> this assumption correct? Anyone knows a fix and/or hack?

The problem is (and this is visible if you make the form a GET rather 
than a POST) that browsers don't send back the name of an image when 
you click on an input type=image. Instead they send back name.x=n and 
name.y=m, where n and m are the x and y offsets in the image where the
mouse was clicked.

So in the above, you'll get add:method.x and add:method.y in the input.

I guess you _could_ hack zope to look for foo:bar.x and foo:bar.y and 
if seen, also put foo:bar in the request, but then, what do you put in
as the value (since image inputs don't send the value through).

Input type=image is a poorly implemented hack, at least in the versions
of browsers I've looked at. (And don't even get me started about the 
javascript support for input type=image.)

What about, instead doing something like
<a href="?add:method=1"><img src="images/add" border="0"></a>

Anthony