I have noticed that when using a SUBMIT type its name attribute gets passed via POST , while an IMAGE type button do not have this data sent, can any one clear this up 开发者_C百科for me? In both instances the NAME attribute is present at HTML level, but only the SUMBIT type has the NAME sent via POST....is this right?
From http://www.w3.org/TR/html401/interact/forms.html#h-17.4:
image
(snip)
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.
When you submit via image, it sends the coordinates of where the image was clicked, so if the image is named image
you'll have the POST parameters image_x
and image_y
精彩评论