cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [OT] input type="image" request param names
Date Sun, 28 Nov 2004 14:59:26 GMT
Joerg Heinicke wrote:

> In our CForms Action.java [1] there is a comment about an IE bug with 
> appending 'x' and 'y' to the name of the input field when it is of 
> type image:
>
> Special workaround an IE bug for <input type="image" name="foo"> :
> in that case, IE only sends "foo.x" and "foo.y" and not "foo" whereas 
> standards-compliant browsers such as Mozilla do send the "foo" parameter.
>
> 1. I "found out" IE *is* standards compliant [2]:
> When a pointing device is used to click on the image, the form is 
> submitted and the click coordinates passed to the server. The x value 
> is measured in pixels from the left of the image, and the y value in 
> pixels from the top of the image. The submitted data includes 
> name.x=x-value and name.y=y-value where "name" is the value of the 
> name attribute, and x-value and y-value are the x and y coordinate 
> values, respectively.


Well, what's the meaning of "the submitted data *includes* name.x..."?

The paragraph above that one says it "creates a graphical submit 
button". Following the "submit button" link says that it "submits a 
form" which in turns links us to the "Form submission" paragraph [3], 
where "Successful controls" says that "every successful control has its 
control name paired with its current value as part of the submitted form 
data set" and that "If a form contains more than one submit button, only 
the activated submit button is successful."

So, my interpretation is that clicking an input of type image makes it a 
successful control and that therefore its name/value pair should be 
sent, and that *additionally* the x and y coordinates should be included.

> 2. My Mozilla 1.7 behaves the same way, both in quirks and standards 
> compliance mode.


Uh? I initially tested image inputs with no problems with Mozilla and 
then added this workaround after testing with IE.

I just made a quick test with Firefox 1.0 on my Mac, and it does send 
the input name also:

<html>
<head><title>test</title></head>
<body>
  <form action="test-img.html" method="GET">
    <input name="text"/>
    <input type="image" src="pic.jpg" name="img" value="Click"/>
  </form>
</body>
</html>

Clicking on the image leads me to 
file://.../test-img.html?text=blah&img.x=42&img.y=36&img=Click

So, where's the truth?

Sylvain

> [1] 
> http://svn.apache.org/viewcvs.cgi/cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Action.java?rev=56962&view=markup

>
> [2] http://www.w3.org/TR/html4/interact/forms.html#idx-coordinates

[3] http://www.w3.org/TR/html4/interact/forms.html#submit-format

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message