« Return to Thread: Zend_Form_Element_Image

Re: Zend_Form_Element_Image

by Matthew Weier O'Phinney-3 :: Rate this Message:

Reply to Author | View in Thread

-- Simon Mundy <simon.mundy@...> wrote
(on Friday, 09 May 2008, 02:15 PM +1000):
> I've just noticed I've been having a lot of trouble trying to identity  
> elements of a type Zend_Form_Element_Image with the isChecked() method.
> From what I can tell, the parent form attempts to validate the element by
> matching the form data key with the element's name. However with image
> form submission, all element keys have the '_x' and '_y' appended to
> them, so that means that the image will never be validated.

Ugh. The W3C says that they should be submitted as <name>.x (not _x) and
<name>.y... but an interesting thing is that different browsers handle
them differently. When I tested originally on FF, it was submitting
three values -- <name> (with the value attributed to the element),
<name>_x (with the X coordinate where the image was clicked), and
<name>_y (with the Y coordinate where the image was clicked) -- so using
just the element name worked fine. Evidently, this isn't true for all
browsers -- and I should not have assumed so, knowing that FF differred
from the W3C.

Obviously, we need better detection, and this logic should likely be in
the form layer (not the element). Could you put an issue in the tracker
for this?

--
Matthew Weier O'Phinney
Software Architect       | matthew@...
Zend - The PHP Company   | http://www.zend.com/

 « Return to Thread: Zend_Form_Element_Image