|
Posted by Jukka K. Korpela on 07/05/07 21:37
Scripsit Bergamot:
> Marnok.com wrote:
>>
>> http://www.marnok.com/test/test.php
>>
>> What I see in Firefox, I click an image, and a "1" is displayed in
>> the echo related to that image.
>> When I try the same in Internet Explorer, I get nothing.
>
> This looks like one of those rare cases where IE isn't doing anything
> wrong.
Yes, though somewhat debatably. A browser is expected to send the x and y
coordinates of the clicked location (this is explicitly stated in the
specifications), but it can be argued that it could, or maybe even should,
_also_ send the name=value pair.
The bottom line is, anyway, that you can't count on getting anything but the
coordinates. You might still find out which button was used, if you use
different name="..." attributes for them. Authors just often get confused
with the ways in which some server-side technologies work with the
coordinate information. More info:
http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
> You probably want a button element instead, but ISTM that IE has other
> problems with that.
It surely has.
It puzzles me why authors take great pains in their efforts to create
problems with image submit buttons, instead of the apparent method of using
normal submit buttons.
Ultimately, in most cases, you simply cannot count on being able to detect
which button was used to submit the form. If the form contains a text input
field, as it usually does, then there's really no way to prevent users from
typing in something there and pressing the enter key. And so the form
submits - without using _any_ of the submit buttons.
Thus, it is usually best to design a form so that all choices are made
before using a submit button, instead of leaving one decision to be made by
choosing among two or more submit buttons. You would then have just one
submit button.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Navigation:
[Reply to this message]
|