开发者

Adding form elements to a form powered by Zend_Form

开发者 https://www.devze.com 2023-01-07 12:30 出处:网络
I have a huge and complex form, and I have build it using Zend_Form. There a开发者_如何学运维re multiple places in the form where the user can add elements on click.

I have a huge and complex form, and I have build it using Zend_Form. There a开发者_如何学运维re multiple places in the form where the user can add elements on click. Currently, if the user submits the form, and the validation fails - the elements added by the user are not retained - as they were not a part of the form. Is there a natural way to add them as a part of the form [emphasis on natural]?


Presumably you are adding new elements to the form using Js.

So you should use Js to populate some hidden field with information about what the user has added to the form. When the form is submitted read in this data and automatically re-add those form elements.

0

精彩评论

暂无评论...
验证码 换一张
取 消