Results 1 to 3 of 3

Thread: Adding dynamic elements to Zend Form

  1. #1
    WalterTamboer is offline Junior Member
    Join Date
    Jul 2008
    Posts
    4

    Default Adding dynamic elements to Zend Form

    Hi everybody,

    Here's my case. For a web application I have to create a form where elements (input boxes) can be added dynamicly by the user. I'm able to create this with jQuery and a normal HTML created form (thus no Zend_Form).

    See jQuery Test - Adding Elements To A Form to get an impression of what I'm aiming at.

    Of course my real-life form will not be as simple as this one so I will be using Zend_Form for that.

    Now my question is, how can I create the same effect with Zend_Form? What if I want validators and filters attached to the dynamic element?

    Thanks.

    p.s.: I'm new to Zend Framework so if I overlooked something, please point me to it

  2. #2
    Morfie is offline Junior Member
    Join Date
    Jun 2011
    Posts
    1

    Default

    Did you ever figure this out? I'd like to know the solution as well. Thanks!

  3. #3
    WalterTamboer is offline Junior Member
    Join Date
    Jul 2008
    Posts
    4

    Default

    Hello Morfie,

    To be honest with you I do not recall how I solved my problem back then. Right now the only thing I can come up with is to create a custom element and set it's $_isArray property to true.
    All filters and validators you add to it will automatically be applied to all dynamic created forms than.

    There are several ways to work with Zend_Form. One can create custom elements and override the render method, one can create custom decorators to change the way an element is rendered, one can create a custom view helper or one can use the ViewScript decorator in order to render a form/element. My advice is to play with Zend_Form a lot and just figure out what floats your boat.

    Good luck.

Similar Threads

  1. Adding dynamic text to forms
    By topcatxx in forum Core Infrastructure
    Replies: 1
    Last Post: 12-07-2009, 09:29 PM
  2. problem adding elements to a zend_form
    By sneddo in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 09-05-2008, 04:39 PM
  3. Zend Form Multi Elements
    By sintec in forum Core Infrastructure
    Replies: 1
    Last Post: 09-04-2008, 11:33 AM
  4. Zend Form - Adding a second Label
    By Matt1776 in forum Core Infrastructure
    Replies: 1
    Last Post: 08-31-2008, 09:25 PM
  5. Zend Form - Creating Form elements
    By dele454 in forum Core Infrastructure
    Replies: 13
    Last Post: 08-17-2008, 03:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •