-- rlewis <[EMAIL PROTECTED]> wrote
(on Tuesday, 08 July 2008, 09:22 AM -0700):
> 
> I've been collaborating on a project that uses Zend, and we've run into a
> seemingly simple problem that we can't figure out. (I'm not very familiar
> with Zend myself, so forgive me if I get something wrong!) On one page of
> the project, we have a form (built using Zend_Form, of course) laid out in a
> table. One row of this table, ROW_1, has an input FIELD_1. The page also has
> a JavaScript link to add a new search row, which clones ROW_1, renames it
> ROW_2 with input FIELD_2, and adds it into the page. Our problem is with the
> post- somewhere, the new FIELD_2 gets stripped from the post data. On
> another page, with a form NOT build with Zend_Form and the same JavaScript,
> we get the full post data we expect. We can't figure out where or why the
> new fields are being ignored, but I imagine it must have something to do
> with Zend not liking a form item it didn't create. If anyone has an idea
> what might be causing this, or knows of a way we can get around it, I'd
> really appreciate hearing it!

Your hunch is right -- Zend_Form strips any fields/parameters that are
not part of its definition when you populate or validate it with a set
of data.

There are ways to get around this -- a number of people have posted
solutions that analyze the data submitted and create additional elements
and/or sub forms on the fly prior to validation. Search in the archives
for some potential solutions.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to