Hi Jamie,
Are you sure about these own form tags for subforms? It is a while ago I
used subforms, but I do not recall that.
From what I recall, subform fields are rendered as
name="subform1[field1]" into the main form. Am I mistaken, is this
deprecated long since?
I do remember that I had to filter out the subforms from the request
parameters, because I also dynamically added them. You could never know
how many there were. So I had to loop over the fields to detect a new
subform in the variables. I remember I also validated them one by one,
but I am not completely sure about that either.
-Bart
Op 23-06-11 08:42, Jamie Krasnoo schreef:
Hey all,
I'm on a project where in the admin for users you have a static part
of the form and a few dynamic parts. The static part is the usual user
name, password, first name, last name, etc. The dynamic part is
putting in street addresses, phone numbers and email addresses.
They'll have to put in at least one of each in order to complete the
form. The person entering the information will have the choice of
opening up or dynamically adding address, phone or email field if they
have additional information to put in. At first I thought that using
Zend_Sub_Form would be ideal but then remembered that each sub form
would be surrounded by its own form tags separating each of the
sections from the others and I wanted the ability to submit all the
fields at once while properly validating the form with its added
sections. I was thinking of removing the default decorators from each
of the sub forms so the form tags wouldn't be rendered and create a
custom decorator for the entire form and custom code to deploy each
section. But what about when additional address, phone or email
sections are created? How would I add validation for those sections?
What would you do to handle this?
Jamie
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]